<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE CPP                   #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE MultiParamTypeClasses #-}</span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# LANGUAGE OverloadedStrings     #-}</span><span>
</span><span id="line-4"></span><span class="hs-pragma">{-# LANGUAGE PatternGuards         #-}</span><span>
</span><span id="line-5"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-6"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- Module      :  Distribution.Fields.Parser</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- License     :  BSD3</span><span>
</span><span id="line-9"></span><span class="hs-comment">--</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- Maintainer  :  cabal-devel@haskell.org</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- Portability :  portable</span><span>
</span><span id="line-12"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Distribution.Fields.Parser</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-13"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Types</span></span><span>
</span><span id="line-14"></span><span>    </span><span class="annot"><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier">Field</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-15"></span><span>    </span><span class="annot"><a href="Distribution.Fields.Field.html#Name"><span class="hs-identifier">Name</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-16"></span><span>    </span><span class="annot"><a href="Distribution.Fields.Field.html#FieldLine"><span class="hs-identifier">FieldLine</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-17"></span><span>    </span><span class="annot"><a href="Distribution.Fields.Field.html#SectionArg"><span class="hs-identifier">SectionArg</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-18"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Grammar and parsing</span></span><span>
</span><span id="line-19"></span><span>    </span><span class="annot"><span class="hs-comment">-- $grammar</span></span><span>
</span><span id="line-20"></span><span>    </span><span class="annot"><a href="Distribution.Fields.Parser.html#readFields"><span class="hs-identifier">readFields</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-21"></span><span>    </span><span class="annot"><a href="Distribution.Fields.Parser.html#readFields%27"><span class="hs-identifier">readFields'</span></a></span><span class="hs-special">,</span><span class="hs-cpp">
#ifdef CABAL_PARSEC_DEBUG
</span><span>    </span><span class="hs-comment">-- * Internal</span><span>
</span><span id="line-24"></span><span>    </span><span class="hs-identifier">parseFile</span><span class="hs-special">,</span><span>
</span><span id="line-25"></span><span>    </span><span class="hs-identifier">parseStr</span><span class="hs-special">,</span><span>
</span><span id="line-26"></span><span>    </span><span class="hs-identifier">parseBS</span><span class="hs-special">,</span><span class="hs-cpp">
#endif
</span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-29"></span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Char8.html#"><span class="hs-identifier">Data.ByteString.Char8</span></a></span><span>          </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">B8</span></span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span>           </span><span class="annot"><a href="../../base/src/Data.Functor.Identity.html#"><span class="hs-identifier">Data.Functor.Identity</span></a></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span>           </span><span class="annot"><a href="Distribution.Compat.Prelude.html"><span class="hs-identifier">Distribution.Compat.Prelude</span></a></span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span>           </span><span class="annot"><a href="Distribution.Fields.Field.html"><span class="hs-identifier">Distribution.Fields.Field</span></a></span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span>           </span><span class="annot"><a href="Distribution.Fields.Lexer.html"><span class="hs-identifier">Distribution.Fields.Lexer</span></a></span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span>           </span><span class="annot"><a href="Distribution.Fields.LexerMonad.html"><span class="hs-identifier">Distribution.Fields.LexerMonad</span></a></span><span>
</span><span id="line-36"></span><span>                 </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.LexerMonad.html#LexResult"><span class="hs-identifier">LexResult</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Fields.LexerMonad.html#LexState"><span class="hs-identifier">LexState</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Fields.LexerMonad.html#LexWarning"><span class="hs-identifier">LexWarning</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Fields.LexerMonad.html#unLex"><span class="hs-identifier">unLex</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-37"></span><span class="hs-keyword">import</span><span>           </span><span class="annot"><a href="Distribution.Parsec.Position.html"><span class="hs-identifier">Distribution.Parsec.Position</span></a></span><span>   </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier">Position</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span>           </span><span class="annot"><a href="../../base/src/Prelude.html#"><span class="hs-identifier">Prelude</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-39"></span><span class="hs-keyword">import</span><span>           </span><span class="annot"><a href="../../parsec/src/Text.Parsec.Combinator.html#"><span class="hs-identifier">Text.Parsec.Combinator</span></a></span><span>         </span><span class="hs-keyword">hiding</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../parsec/src/Text.Parsec.Combinator.html#eof"><span class="hs-identifier">eof</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../parsec/src/Text.Parsec.Combinator.html#notFollowedBy"><span class="hs-identifier">notFollowedBy</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span>           </span><span class="annot"><a href="../../parsec/src/Text.Parsec.Error.html#"><span class="hs-identifier">Text.Parsec.Error</span></a></span><span>
</span><span id="line-41"></span><span class="hs-keyword">import</span><span>           </span><span class="annot"><a href="../../parsec/src/Text.Parsec.Pos.html#"><span class="hs-identifier">Text.Parsec.Pos</span></a></span><span>
</span><span id="line-42"></span><span class="hs-keyword">import</span><span>           </span><span class="annot"><a href="../../parsec/src/Text.Parsec.Prim.html#"><span class="hs-identifier">Text.Parsec.Prim</span></a></span><span>               </span><span class="hs-keyword">hiding</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../parsec/src/Text.Parsec.Prim.html#many"><span class="hs-identifier">many</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../parsec/src/Text.Parsec.Prim.html#%3C%7C%3E"><span class="hs-operator">(&lt;|&gt;)</span></a></span><span class="hs-special">)</span><span class="hs-cpp">

#ifdef CABAL_PARSEC_DEBUG
</span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data.Text</span><span>                </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">T</span><span>
</span><span id="line-46"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data.Text.Encoding</span><span>       </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">T</span><span>
</span><span id="line-47"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data.Text.Encoding.Error</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">T</span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-50"></span><span class="hs-comment">-- | The 'LexState'' (with a prime) is an instance of parsec's 'Stream'</span><span>
</span><span id="line-51"></span><span class="hs-comment">-- wrapped around lexer's 'LexState' (without a prime)</span><span>
</span><span id="line-52"></span><span class="hs-keyword">data</span><span> </span><span id="LexState%27"><span class="annot"><a href="Distribution.Fields.Parser.html#LexState%27"><span class="hs-identifier hs-var">LexState'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="LexState%27"><span class="annot"><a href="Distribution.Fields.Parser.html#LexState%27"><span class="hs-identifier hs-var">LexState'</span></a></span></span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="Distribution.Fields.LexerMonad.html#LexState"><span class="hs-identifier hs-type">LexState</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Lexer.html#LToken"><span class="hs-identifier hs-type">LToken</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#LexState%27"><span class="hs-identifier hs-type">LexState'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-53"></span><span>
</span><span id="line-54"></span><span class="annot"><a href="Distribution.Fields.Parser.html#mkLexState%27"><span class="hs-identifier hs-type">mkLexState'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Fields.LexerMonad.html#LexState"><span class="hs-identifier hs-type">LexState</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#LexState%27"><span class="hs-identifier hs-type">LexState'</span></a></span><span>
</span><span id="line-55"></span><span id="mkLexState%27"><span class="annot"><span class="annottext">mkLexState' :: LexState -&gt; LexState'
</span><a href="Distribution.Fields.Parser.html#mkLexState%27"><span class="hs-identifier hs-var hs-var">mkLexState'</span></a></span></span><span> </span><span id="local-6989586621679623269"><span class="annot"><span class="annottext">LexState
</span><a href="#local-6989586621679623269"><span class="hs-identifier hs-var">st</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LexState -&gt; (LToken, LexState') -&gt; LexState'
</span><a href="Distribution.Fields.Parser.html#LexState%27"><span class="hs-identifier hs-var">LexState'</span></a></span><span> </span><span class="annot"><span class="annottext">LexState
</span><a href="#local-6989586621679623269"><span class="hs-identifier hs-var">st</span></a></span><span>
</span><span id="line-56"></span><span>                   </span><span class="hs-special">(</span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Lex LToken -&gt; LexState -&gt; LexResult LToken
forall a. Lex a -&gt; LexState -&gt; LexResult a
</span><a href="Distribution.Fields.LexerMonad.html#unLex"><span class="hs-identifier hs-var hs-var">unLex</span></a></span><span> </span><span class="annot"><span class="annottext">Lex LToken
</span><a href="Distribution.Fields.Lexer.html#lexToken"><span class="hs-identifier hs-var">lexToken</span></a></span><span> </span><span class="annot"><span class="annottext">LexState
</span><a href="#local-6989586621679623269"><span class="hs-identifier hs-var">st</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="annot"><a href="Distribution.Fields.LexerMonad.html#LexResult"><span class="hs-identifier hs-type">LexResult</span></a></span><span> </span><span id="local-6989586621679623266"><span class="annot"><span class="annottext">LexState
</span><a href="#local-6989586621679623266"><span class="hs-identifier hs-var">st'</span></a></span></span><span> </span><span id="local-6989586621679623265"><span class="annot"><span class="annottext">LToken
</span><a href="#local-6989586621679623265"><span class="hs-identifier hs-var">tok</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LToken
</span><a href="#local-6989586621679623265"><span class="hs-identifier hs-var">tok</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">LexState -&gt; LexState'
</span><a href="Distribution.Fields.Parser.html#mkLexState%27"><span class="hs-identifier hs-var">mkLexState'</span></a></span><span> </span><span class="annot"><span class="annottext">LexState
</span><a href="#local-6989586621679623266"><span class="hs-identifier hs-var">st'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-57"></span><span>
</span><span id="line-58"></span><span class="hs-keyword">type</span><span> </span><span id="Parser"><span class="annot"><a href="Distribution.Fields.Parser.html#Parser"><span class="hs-identifier hs-var">Parser</span></a></span></span><span> </span><span id="local-6989586621679623264"><span class="annot"><a href="#local-6989586621679623264"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="../../parsec/src/Text.Parsec.Prim.html#ParsecT"><span class="hs-identifier hs-type">ParsecT</span></a></span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#LexState%27"><span class="hs-identifier hs-type">LexState'</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Identity.html#Identity"><span class="hs-identifier hs-type">Identity</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679623264"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-59"></span><span>
</span><span id="line-60"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="../../parsec/src/Text.Parsec.Prim.html#Stream"><span class="hs-identifier hs-type">Stream</span></a></span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#LexState%27"><span class="hs-identifier hs-type">LexState'</span></a></span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Identity.html#Identity"><span class="hs-identifier hs-type">Identity</span></a></span><span> </span><span class="annot"><a href="Distribution.Fields.Lexer.html#LToken"><span class="hs-identifier hs-type">LToken</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-61"></span><span>  </span><span id="local-6989586621679623257"><span class="annot"><span class="annottext">uncons :: LexState' -&gt; Identity (Maybe (LToken, LexState'))
</span><a href="../../parsec/src/Text.Parsec.Prim.html#uncons"><span class="hs-identifier hs-var hs-var hs-var hs-var">uncons</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Parser.html#LexState%27"><span class="hs-identifier hs-type">LexState'</span></a></span><span> </span><span class="annot"><span class="annottext">LexState
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679623255"><span class="annot"><span class="annottext">LToken
</span><a href="#local-6989586621679623255"><span class="hs-identifier hs-var">tok</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679623254"><span class="annot"><span class="annottext">LexState'
</span><a href="#local-6989586621679623254"><span class="hs-identifier hs-var">st'</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-62"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">LToken
</span><a href="#local-6989586621679623255"><span class="hs-identifier hs-var">tok</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-63"></span><span>      </span><span class="annot"><a href="Distribution.Fields.Lexer.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Token
</span><a href="Distribution.Fields.Lexer.html#EOF"><span class="hs-identifier hs-var">EOF</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe (LToken, LexState') -&gt; Identity (Maybe (LToken, LexState'))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (LToken, LexState')
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-64"></span><span>      </span><span class="annot"><span class="annottext">LToken
</span><span class="hs-identifier">_</span></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe (LToken, LexState') -&gt; Identity (Maybe (LToken, LexState'))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(LToken, LexState') -&gt; Maybe (LToken, LexState')
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LToken
</span><a href="#local-6989586621679623255"><span class="hs-identifier hs-var">tok</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">LexState'
</span><a href="#local-6989586621679623254"><span class="hs-identifier hs-var">st'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-65"></span><span>
</span><span id="line-66"></span><span class="hs-comment">-- | Get lexer warnings accumulated so far</span><span>
</span><span id="line-67"></span><span class="annot"><a href="Distribution.Fields.Parser.html#getLexerWarnings"><span class="hs-identifier hs-type">getLexerWarnings</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#Parser"><span class="hs-identifier hs-type">Parser</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.LexerMonad.html#LexWarning"><span class="hs-identifier hs-type">LexWarning</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-68"></span><span id="getLexerWarnings"><span class="annot"><span class="annottext">getLexerWarnings :: Parser [LexWarning]
</span><a href="Distribution.Fields.Parser.html#getLexerWarnings"><span class="hs-identifier hs-var hs-var">getLexerWarnings</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-69"></span><span>  </span><span class="annot"><a href="Distribution.Fields.Parser.html#LexState%27"><span class="hs-identifier hs-type">LexState'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.LexerMonad.html#LexState"><span class="hs-identifier hs-type">LexState</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">warnings :: LexState -&gt; [LexWarning]
</span><a href="Distribution.Fields.LexerMonad.html#warnings"><span class="hs-identifier hs-var">warnings</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621679623248"><span class="annot"><span class="annottext">[LexWarning]
</span><a href="#local-6989586621679623248"><span class="hs-identifier hs-var">ws</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(LToken, LexState')
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ParsecT LexState' () Identity LexState'
forall (m :: * -&gt; *) s u. Monad m =&gt; ParsecT s u m s
</span><a href="../../parsec/src/Text.Parsec.Prim.html#getInput"><span class="hs-identifier hs-var">getInput</span></a></span><span>
</span><span id="line-70"></span><span>  </span><span class="annot"><span class="annottext">[LexWarning] -&gt; Parser [LexWarning]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">[LexWarning]
</span><a href="#local-6989586621679623248"><span class="hs-identifier hs-var">ws</span></a></span><span>
</span><span id="line-71"></span><span>
</span><span id="line-72"></span><span class="hs-comment">-- | Set Alex code i.e. the mode &quot;state&quot; lexer is in.</span><span>
</span><span id="line-73"></span><span class="annot"><a href="Distribution.Fields.Parser.html#setLexerMode"><span class="hs-identifier hs-type">setLexerMode</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#Parser"><span class="hs-identifier hs-type">Parser</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-74"></span><span id="setLexerMode"><span class="annot"><span class="annottext">setLexerMode :: Int -&gt; Parser ()
</span><a href="Distribution.Fields.Parser.html#setLexerMode"><span class="hs-identifier hs-var hs-var">setLexerMode</span></a></span></span><span> </span><span id="local-6989586621679623245"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679623245"><span class="hs-identifier hs-var">code</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-75"></span><span>  </span><span class="annot"><a href="Distribution.Fields.Parser.html#LexState%27"><span class="hs-identifier hs-type">LexState'</span></a></span><span> </span><span id="local-6989586621679623244"><span class="annot"><span class="annottext">LexState
</span><a href="#local-6989586621679623244"><span class="hs-identifier hs-var">ls</span></a></span></span><span> </span><span class="annot"><span class="annottext">(LToken, LexState')
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ParsecT LexState' () Identity LexState'
forall (m :: * -&gt; *) s u. Monad m =&gt; ParsecT s u m s
</span><a href="../../parsec/src/Text.Parsec.Prim.html#getInput"><span class="hs-identifier hs-var">getInput</span></a></span><span>
</span><span id="line-76"></span><span>  </span><span class="annot"><span class="annottext">LexState' -&gt; Parser ()
forall (m :: * -&gt; *) s u. Monad m =&gt; s -&gt; ParsecT s u m ()
</span><a href="../../parsec/src/Text.Parsec.Prim.html#setInput"><span class="hs-identifier hs-var">setInput</span></a></span><span> </span><span class="annot"><span class="annottext">(LexState' -&gt; Parser ()) -&gt; LexState' -&gt; Parser ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">LexState -&gt; LexState'
</span><a href="Distribution.Fields.Parser.html#mkLexState%27"><span class="hs-identifier hs-var">mkLexState'</span></a></span><span> </span><span class="annot"><span class="annottext">LexState
</span><a href="#local-6989586621679623244"><span class="hs-identifier hs-var">ls</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">curCode :: Int
</span><a href="Distribution.Fields.LexerMonad.html#curCode"><span class="hs-identifier hs-var">curCode</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679623245"><span class="hs-identifier hs-var">code</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-77"></span><span>
</span><span id="line-78"></span><span id="local-6989586621679623442"><span class="annot"><a href="Distribution.Fields.Parser.html#getToken"><span class="hs-identifier hs-type">getToken</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Lexer.html#Token"><span class="hs-identifier hs-type">Token</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679623442"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#Parser"><span class="hs-identifier hs-type">Parser</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679623442"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-79"></span><span id="getToken"><span class="annot"><span class="annottext">getToken :: forall a. (Token -&gt; Maybe a) -&gt; Parser a
</span><a href="Distribution.Fields.Parser.html#getToken"><span class="hs-identifier hs-var hs-var">getToken</span></a></span></span><span> </span><span id="local-6989586621679623239"><span class="annot"><span class="annottext">Token -&gt; Maybe a
</span><a href="#local-6989586621679623239"><span class="hs-identifier hs-var">getTok</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(LToken -&gt; Maybe a) -&gt; Parser a
forall a. (LToken -&gt; Maybe a) -&gt; Parser a
</span><a href="Distribution.Fields.Parser.html#getTokenWithPos"><span class="hs-identifier hs-var">getTokenWithPos</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Lexer.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679623237"><span class="annot"><span class="annottext">Token
</span><a href="#local-6989586621679623237"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Token -&gt; Maybe a
</span><a href="#local-6989586621679623239"><span class="hs-identifier hs-var">getTok</span></a></span><span> </span><span class="annot"><span class="annottext">Token
</span><a href="#local-6989586621679623237"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-80"></span><span>
</span><span id="line-81"></span><span id="local-6989586621679623440"><span class="annot"><a href="Distribution.Fields.Parser.html#getTokenWithPos"><span class="hs-identifier hs-type">getTokenWithPos</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Lexer.html#LToken"><span class="hs-identifier hs-type">LToken</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679623440"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#Parser"><span class="hs-identifier hs-type">Parser</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679623440"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-82"></span><span id="getTokenWithPos"><span class="annot"><span class="annottext">getTokenWithPos :: forall a. (LToken -&gt; Maybe a) -&gt; Parser a
</span><a href="Distribution.Fields.Parser.html#getTokenWithPos"><span class="hs-identifier hs-var hs-var">getTokenWithPos</span></a></span></span><span> </span><span id="local-6989586621679623235"><span class="annot"><span class="annottext">LToken -&gt; Maybe a
</span><a href="#local-6989586621679623235"><span class="hs-identifier hs-var">getTok</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(LToken -&gt; [Char])
-&gt; (SourcePos -&gt; LToken -&gt; LexState' -&gt; SourcePos)
-&gt; (LToken -&gt; Maybe a)
-&gt; ParsecT LexState' () Identity a
forall s (m :: * -&gt; *) t a u.
Stream s m t =&gt;
(t -&gt; [Char])
-&gt; (SourcePos -&gt; t -&gt; s -&gt; SourcePos)
-&gt; (t -&gt; Maybe a)
-&gt; ParsecT s u m a
</span><a href="../../parsec/src/Text.Parsec.Prim.html#tokenPrim"><span class="hs-identifier hs-var">tokenPrim</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Lexer.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679623233"><span class="annot"><span class="annottext">Token
</span><a href="#local-6989586621679623233"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Token -&gt; [Char]
</span><a href="Distribution.Fields.Parser.html#describeToken"><span class="hs-identifier hs-var">describeToken</span></a></span><span> </span><span class="annot"><span class="annottext">Token
</span><a href="#local-6989586621679623233"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SourcePos -&gt; LToken -&gt; LexState' -&gt; SourcePos
</span><a href="#local-6989586621679623231"><span class="hs-identifier hs-var">updatePos</span></a></span><span> </span><span class="annot"><span class="annottext">LToken -&gt; Maybe a
</span><a href="#local-6989586621679623235"><span class="hs-identifier hs-var">getTok</span></a></span><span>
</span><span id="line-83"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-84"></span><span>    </span><span class="annot"><a href="#local-6989586621679623231"><span class="hs-identifier hs-type">updatePos</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../parsec/src/Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.Lexer.html#LToken"><span class="hs-identifier hs-type">LToken</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#LexState%27"><span class="hs-identifier hs-type">LexState'</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../parsec/src/Text.Parsec.Pos.html#SourcePos"><span class="hs-identifier hs-type">SourcePos</span></a></span><span>
</span><span id="line-85"></span><span>    </span><span id="local-6989586621679623231"><span class="annot"><span class="annottext">updatePos :: SourcePos -&gt; LToken -&gt; LexState' -&gt; SourcePos
</span><a href="#local-6989586621679623231"><span class="hs-identifier hs-var hs-var">updatePos</span></a></span></span><span> </span><span id="local-6989586621679623230"><span class="annot"><span class="annottext">SourcePos
</span><a href="#local-6989586621679623230"><span class="hs-identifier hs-var">pos</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Lexer.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span> </span><span id="local-6989586621679623228"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679623228"><span class="hs-identifier hs-var">col</span></a></span></span><span> </span><span id="local-6989586621679623227"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679623227"><span class="hs-identifier hs-var">line</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Token
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LexState'
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; Int -&gt; Int -&gt; SourcePos
</span><a href="../../parsec/src/Text.Parsec.Pos.html#newPos"><span class="hs-identifier hs-var">newPos</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SourcePos -&gt; [Char]
</span><a href="../../parsec/src/Text.Parsec.Pos.html#sourceName"><span class="hs-identifier hs-var">sourceName</span></a></span><span> </span><span class="annot"><span class="annottext">SourcePos
</span><a href="#local-6989586621679623230"><span class="hs-identifier hs-var">pos</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679623228"><span class="hs-identifier hs-var">col</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679623227"><span class="hs-identifier hs-var">line</span></a></span><span>
</span><span id="line-86"></span><span>
</span><span id="line-87"></span><span class="annot"><a href="Distribution.Fields.Parser.html#describeToken"><span class="hs-identifier hs-type">describeToken</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Fields.Lexer.html#Token"><span class="hs-identifier hs-type">Token</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-88"></span><span id="describeToken"><span class="annot"><span class="annottext">describeToken :: Token -&gt; [Char]
</span><a href="Distribution.Fields.Parser.html#describeToken"><span class="hs-identifier hs-var hs-var">describeToken</span></a></span></span><span> </span><span id="local-6989586621679623224"><span class="annot"><span class="annottext">Token
</span><a href="#local-6989586621679623224"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Token
</span><a href="#local-6989586621679623224"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-89"></span><span>  </span><span class="annot"><a href="Distribution.Fields.Lexer.html#TokSym"><span class="hs-identifier hs-type">TokSym</span></a></span><span>   </span><span id="local-6989586621679623222"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679623222"><span class="hs-identifier hs-var">s</span></a></span></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;symbol &quot;</span></span><span>   </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; [Char]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; [Char]
forall a. Show a =&gt; a -&gt; [Char]
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679623222"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-90"></span><span>  </span><span class="annot"><a href="Distribution.Fields.Lexer.html#TokStr"><span class="hs-identifier hs-type">TokStr</span></a></span><span>   </span><span id="local-6989586621679623219"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679623219"><span class="hs-identifier hs-var">s</span></a></span></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;string &quot;</span></span><span>   </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; [Char]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; [Char]
forall a. Show a =&gt; a -&gt; [Char]
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679623219"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-91"></span><span>  </span><span class="annot"><a href="Distribution.Fields.Lexer.html#TokOther"><span class="hs-identifier hs-type">TokOther</span></a></span><span> </span><span id="local-6989586621679623217"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679623217"><span class="hs-identifier hs-var">s</span></a></span></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;operator &quot;</span></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; [Char]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; [Char]
forall a. Show a =&gt; a -&gt; [Char]
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679623217"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-92"></span><span>  </span><span class="annot"><a href="Distribution.Fields.Lexer.html#Indent"><span class="hs-identifier hs-type">Indent</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;new line&quot;</span></span><span>
</span><span id="line-93"></span><span>  </span><span class="annot"><a href="Distribution.Fields.Lexer.html#TokFieldLine"><span class="hs-identifier hs-type">TokFieldLine</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;field content&quot;</span></span><span>
</span><span id="line-94"></span><span>  </span><span class="annot"><span class="annottext">Token
</span><a href="Distribution.Fields.Lexer.html#Colon"><span class="hs-identifier hs-var">Colon</span></a></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;\&quot;:\&quot;&quot;</span></span><span>
</span><span id="line-95"></span><span>  </span><span class="annot"><span class="annottext">Token
</span><a href="Distribution.Fields.Lexer.html#OpenBrace"><span class="hs-identifier hs-var">OpenBrace</span></a></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;\&quot;{\&quot;&quot;</span></span><span>
</span><span id="line-96"></span><span>  </span><span class="annot"><span class="annottext">Token
</span><a href="Distribution.Fields.Lexer.html#CloseBrace"><span class="hs-identifier hs-var">CloseBrace</span></a></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;\&quot;}\&quot;&quot;</span></span><span>
</span><span id="line-97"></span><span class="hs-comment">--  SemiColon       -&gt; &quot;\&quot;;\&quot;&quot;</span><span>
</span><span id="line-98"></span><span>  </span><span class="annot"><span class="annottext">Token
</span><a href="Distribution.Fields.Lexer.html#EOF"><span class="hs-identifier hs-var">EOF</span></a></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;end of file&quot;</span></span><span>
</span><span id="line-99"></span><span>  </span><span class="annot"><a href="Distribution.Fields.Lexer.html#LexicalError"><span class="hs-identifier hs-type">LexicalError</span></a></span><span> </span><span id="local-6989586621679623210"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679623210"><span class="hs-identifier hs-var">is</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;character in input &quot;</span></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; [Char]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; [Char]
forall a. Show a =&gt; a -&gt; [Char]
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; Char
</span><a href="../../bytestring/src/Data.ByteString.Char8.html#head"><span class="hs-identifier hs-var">B8.head</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679623210"><span class="hs-identifier hs-var">is</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-100"></span><span>
</span><span id="line-101"></span><span class="annot"><a href="Distribution.Fields.Parser.html#tokSym"><span class="hs-identifier hs-type">tokSym</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#Parser"><span class="hs-identifier hs-type">Parser</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Field.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-102"></span><span class="annot"><a href="Distribution.Fields.Parser.html#tokSym%27"><span class="hs-identifier hs-type">tokSym'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#tokStr"><span class="hs-identifier hs-type">tokStr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#tokOther"><span class="hs-identifier hs-type">tokOther</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#Parser"><span class="hs-identifier hs-type">Parser</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Field.html#SectionArg"><span class="hs-identifier hs-type">SectionArg</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-103"></span><span class="annot"><a href="Distribution.Fields.Parser.html#tokIndent"><span class="hs-identifier hs-type">tokIndent</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#Parser"><span class="hs-identifier hs-type">Parser</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-104"></span><span class="annot"><a href="Distribution.Fields.Parser.html#tokColon"><span class="hs-identifier hs-type">tokColon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#tokOpenBrace"><span class="hs-identifier hs-type">tokOpenBrace</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#tokCloseBrace"><span class="hs-identifier hs-type">tokCloseBrace</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#Parser"><span class="hs-identifier hs-type">Parser</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-105"></span><span class="annot"><a href="Distribution.Fields.Parser.html#tokFieldLine"><span class="hs-identifier hs-type">tokFieldLine</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#Parser"><span class="hs-identifier hs-type">Parser</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Field.html#FieldLine"><span class="hs-identifier hs-type">FieldLine</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-106"></span><span>
</span><span id="line-107"></span><span id="tokSym"><span class="annot"><span class="annottext">tokSym :: Parser (Name Position)
</span><a href="Distribution.Fields.Parser.html#tokSym"><span class="hs-identifier hs-var hs-var">tokSym</span></a></span></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(LToken -&gt; Maybe (Name Position)) -&gt; Parser (Name Position)
forall a. (LToken -&gt; Maybe a) -&gt; Parser a
</span><a href="Distribution.Fields.Parser.html#getTokenWithPos"><span class="hs-identifier hs-var">getTokenWithPos</span></a></span><span> </span><span class="annot"><span class="annottext">((LToken -&gt; Maybe (Name Position)) -&gt; Parser (Name Position))
-&gt; (LToken -&gt; Maybe (Name Position)) -&gt; Parser (Name Position)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679623199"><span class="annot"><span class="annottext">LToken
</span><a href="#local-6989586621679623199"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">LToken
</span><a href="#local-6989586621679623199"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="annot"><a href="Distribution.Fields.Lexer.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621679623198"><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679623198"><span class="hs-identifier hs-var">pos</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Lexer.html#TokSym"><span class="hs-identifier hs-type">TokSym</span></a></span><span>   </span><span id="local-6989586621679623197"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679623197"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Name Position -&gt; Maybe (Name Position)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Position -&gt; ByteString -&gt; Name Position
forall ann. ann -&gt; ByteString -&gt; Name ann
</span><a href="Distribution.Fields.Field.html#mkName"><span class="hs-identifier hs-var">mkName</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679623198"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679623197"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span class="hs-special">;</span><span>  </span><span class="annot"><span class="annottext">LToken
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe (Name Position)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-108"></span><span id="tokSym%27"><span class="annot"><span class="annottext">tokSym' :: Parser (SectionArg Position)
</span><a href="Distribution.Fields.Parser.html#tokSym%27"><span class="hs-identifier hs-var hs-var">tokSym'</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(LToken -&gt; Maybe (SectionArg Position))
-&gt; Parser (SectionArg Position)
forall a. (LToken -&gt; Maybe a) -&gt; Parser a
</span><a href="Distribution.Fields.Parser.html#getTokenWithPos"><span class="hs-identifier hs-var">getTokenWithPos</span></a></span><span> </span><span class="annot"><span class="annottext">((LToken -&gt; Maybe (SectionArg Position))
 -&gt; Parser (SectionArg Position))
-&gt; (LToken -&gt; Maybe (SectionArg Position))
-&gt; Parser (SectionArg Position)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679623195"><span class="annot"><span class="annottext">LToken
</span><a href="#local-6989586621679623195"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">LToken
</span><a href="#local-6989586621679623195"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="annot"><a href="Distribution.Fields.Lexer.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621679623194"><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679623194"><span class="hs-identifier hs-var">pos</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Lexer.html#TokSym"><span class="hs-identifier hs-type">TokSym</span></a></span><span>   </span><span id="local-6989586621679623193"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679623193"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">SectionArg Position -&gt; Maybe (SectionArg Position)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Position -&gt; ByteString -&gt; SectionArg Position
forall ann. ann -&gt; ByteString -&gt; SectionArg ann
</span><a href="Distribution.Fields.Field.html#SecArgName"><span class="hs-identifier hs-var">SecArgName</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679623194"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679623193"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span class="hs-special">;</span><span>  </span><span class="annot"><span class="annottext">LToken
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe (SectionArg Position)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-109"></span><span id="tokStr"><span class="annot"><span class="annottext">tokStr :: Parser (SectionArg Position)
</span><a href="Distribution.Fields.Parser.html#tokStr"><span class="hs-identifier hs-var hs-var">tokStr</span></a></span></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(LToken -&gt; Maybe (SectionArg Position))
-&gt; Parser (SectionArg Position)
forall a. (LToken -&gt; Maybe a) -&gt; Parser a
</span><a href="Distribution.Fields.Parser.html#getTokenWithPos"><span class="hs-identifier hs-var">getTokenWithPos</span></a></span><span> </span><span class="annot"><span class="annottext">((LToken -&gt; Maybe (SectionArg Position))
 -&gt; Parser (SectionArg Position))
-&gt; (LToken -&gt; Maybe (SectionArg Position))
-&gt; Parser (SectionArg Position)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679623191"><span class="annot"><span class="annottext">LToken
</span><a href="#local-6989586621679623191"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">LToken
</span><a href="#local-6989586621679623191"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="annot"><a href="Distribution.Fields.Lexer.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621679623190"><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679623190"><span class="hs-identifier hs-var">pos</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Lexer.html#TokStr"><span class="hs-identifier hs-type">TokStr</span></a></span><span>   </span><span id="local-6989586621679623189"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679623189"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">SectionArg Position -&gt; Maybe (SectionArg Position)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Position -&gt; ByteString -&gt; SectionArg Position
forall ann. ann -&gt; ByteString -&gt; SectionArg ann
</span><a href="Distribution.Fields.Field.html#SecArgStr"><span class="hs-identifier hs-var">SecArgStr</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679623190"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679623189"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span class="hs-special">;</span><span>  </span><span class="annot"><span class="annottext">LToken
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe (SectionArg Position)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-110"></span><span id="tokOther"><span class="annot"><span class="annottext">tokOther :: Parser (SectionArg Position)
</span><a href="Distribution.Fields.Parser.html#tokOther"><span class="hs-identifier hs-var hs-var">tokOther</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(LToken -&gt; Maybe (SectionArg Position))
-&gt; Parser (SectionArg Position)
forall a. (LToken -&gt; Maybe a) -&gt; Parser a
</span><a href="Distribution.Fields.Parser.html#getTokenWithPos"><span class="hs-identifier hs-var">getTokenWithPos</span></a></span><span> </span><span class="annot"><span class="annottext">((LToken -&gt; Maybe (SectionArg Position))
 -&gt; Parser (SectionArg Position))
-&gt; (LToken -&gt; Maybe (SectionArg Position))
-&gt; Parser (SectionArg Position)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679623187"><span class="annot"><span class="annottext">LToken
</span><a href="#local-6989586621679623187"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">LToken
</span><a href="#local-6989586621679623187"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="annot"><a href="Distribution.Fields.Lexer.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621679623186"><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679623186"><span class="hs-identifier hs-var">pos</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Lexer.html#TokOther"><span class="hs-identifier hs-type">TokOther</span></a></span><span> </span><span id="local-6989586621679623185"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679623185"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">SectionArg Position -&gt; Maybe (SectionArg Position)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Position -&gt; ByteString -&gt; SectionArg Position
forall ann. ann -&gt; ByteString -&gt; SectionArg ann
</span><a href="Distribution.Fields.Field.html#SecArgOther"><span class="hs-identifier hs-var">SecArgOther</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679623186"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679623185"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span class="hs-special">;</span><span>  </span><span class="annot"><span class="annottext">LToken
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe (SectionArg Position)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-111"></span><span id="tokIndent"><span class="annot"><span class="annottext">tokIndent :: Parser Int
</span><a href="Distribution.Fields.Parser.html#tokIndent"><span class="hs-identifier hs-var hs-var">tokIndent</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Token -&gt; Maybe Int) -&gt; Parser Int
forall a. (Token -&gt; Maybe a) -&gt; Parser a
</span><a href="Distribution.Fields.Parser.html#getToken"><span class="hs-identifier hs-var">getToken</span></a></span><span> </span><span class="annot"><span class="annottext">((Token -&gt; Maybe Int) -&gt; Parser Int)
-&gt; (Token -&gt; Maybe Int) -&gt; Parser Int
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679623183"><span class="annot"><span class="annottext">Token
</span><a href="#local-6989586621679623183"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Token
</span><a href="#local-6989586621679623183"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="annot"><a href="Distribution.Fields.Lexer.html#Indent"><span class="hs-identifier hs-type">Indent</span></a></span><span>   </span><span id="local-6989586621679623182"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679623182"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Maybe Int
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679623182"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">;</span><span>  </span><span class="annot"><span class="annottext">Token
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe Int
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-112"></span><span id="tokColon"><span class="annot"><span class="annottext">tokColon :: Parser ()
</span><a href="Distribution.Fields.Parser.html#tokColon"><span class="hs-identifier hs-var hs-var">tokColon</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Token -&gt; Maybe ()) -&gt; Parser ()
forall a. (Token -&gt; Maybe a) -&gt; Parser a
</span><a href="Distribution.Fields.Parser.html#getToken"><span class="hs-identifier hs-var">getToken</span></a></span><span> </span><span class="annot"><span class="annottext">((Token -&gt; Maybe ()) -&gt; Parser ())
-&gt; (Token -&gt; Maybe ()) -&gt; Parser ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679623181"><span class="annot"><span class="annottext">Token
</span><a href="#local-6989586621679623181"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Token
</span><a href="#local-6989586621679623181"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="annot"><span class="annottext">Token
</span><a href="Distribution.Fields.Lexer.html#Colon"><span class="hs-identifier hs-var">Colon</span></a></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">() -&gt; Maybe ()
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Token
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe ()
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-113"></span><span id="tokOpenBrace"><span class="annot"><span class="annottext">tokOpenBrace :: Parser ()
</span><a href="Distribution.Fields.Parser.html#tokOpenBrace"><span class="hs-identifier hs-var hs-var">tokOpenBrace</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Token -&gt; Maybe ()) -&gt; Parser ()
forall a. (Token -&gt; Maybe a) -&gt; Parser a
</span><a href="Distribution.Fields.Parser.html#getToken"><span class="hs-identifier hs-var">getToken</span></a></span><span> </span><span class="annot"><span class="annottext">((Token -&gt; Maybe ()) -&gt; Parser ())
-&gt; (Token -&gt; Maybe ()) -&gt; Parser ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679623180"><span class="annot"><span class="annottext">Token
</span><a href="#local-6989586621679623180"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Token
</span><a href="#local-6989586621679623180"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="annot"><span class="annottext">Token
</span><a href="Distribution.Fields.Lexer.html#OpenBrace"><span class="hs-identifier hs-var">OpenBrace</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">() -&gt; Maybe ()
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Token
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe ()
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-114"></span><span id="tokCloseBrace"><span class="annot"><span class="annottext">tokCloseBrace :: Parser ()
</span><a href="Distribution.Fields.Parser.html#tokCloseBrace"><span class="hs-identifier hs-var hs-var">tokCloseBrace</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Token -&gt; Maybe ()) -&gt; Parser ()
forall a. (Token -&gt; Maybe a) -&gt; Parser a
</span><a href="Distribution.Fields.Parser.html#getToken"><span class="hs-identifier hs-var">getToken</span></a></span><span> </span><span class="annot"><span class="annottext">((Token -&gt; Maybe ()) -&gt; Parser ())
-&gt; (Token -&gt; Maybe ()) -&gt; Parser ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679623179"><span class="annot"><span class="annottext">Token
</span><a href="#local-6989586621679623179"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Token
</span><a href="#local-6989586621679623179"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="annot"><span class="annottext">Token
</span><a href="Distribution.Fields.Lexer.html#CloseBrace"><span class="hs-identifier hs-var">CloseBrace</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">() -&gt; Maybe ()
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Token
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe ()
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-115"></span><span id="tokFieldLine"><span class="annot"><span class="annottext">tokFieldLine :: Parser (FieldLine Position)
</span><a href="Distribution.Fields.Parser.html#tokFieldLine"><span class="hs-identifier hs-var hs-var">tokFieldLine</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(LToken -&gt; Maybe (FieldLine Position))
-&gt; Parser (FieldLine Position)
forall a. (LToken -&gt; Maybe a) -&gt; Parser a
</span><a href="Distribution.Fields.Parser.html#getTokenWithPos"><span class="hs-identifier hs-var">getTokenWithPos</span></a></span><span> </span><span class="annot"><span class="annottext">((LToken -&gt; Maybe (FieldLine Position))
 -&gt; Parser (FieldLine Position))
-&gt; (LToken -&gt; Maybe (FieldLine Position))
-&gt; Parser (FieldLine Position)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679623178"><span class="annot"><span class="annottext">LToken
</span><a href="#local-6989586621679623178"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">LToken
</span><a href="#local-6989586621679623178"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="annot"><a href="Distribution.Fields.Lexer.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621679623177"><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679623177"><span class="hs-identifier hs-var">pos</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Lexer.html#TokFieldLine"><span class="hs-identifier hs-type">TokFieldLine</span></a></span><span> </span><span id="local-6989586621679623176"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679623176"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FieldLine Position -&gt; Maybe (FieldLine Position)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Position -&gt; ByteString -&gt; FieldLine Position
forall ann. ann -&gt; ByteString -&gt; FieldLine ann
</span><a href="Distribution.Fields.Field.html#FieldLine"><span class="hs-identifier hs-var">FieldLine</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><a href="#local-6989586621679623177"><span class="hs-identifier hs-var">pos</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679623176"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">LToken
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe (FieldLine Position)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-116"></span><span>
</span><span id="line-117"></span><span class="annot"><a href="Distribution.Fields.Parser.html#colon"><span class="hs-identifier hs-type">colon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#openBrace"><span class="hs-identifier hs-type">openBrace</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#closeBrace"><span class="hs-identifier hs-type">closeBrace</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#Parser"><span class="hs-identifier hs-type">Parser</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-118"></span><span>
</span><span id="line-119"></span><span class="annot"><a href="Distribution.Fields.Parser.html#sectionArg"><span class="hs-identifier hs-type">sectionArg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#Parser"><span class="hs-identifier hs-type">Parser</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Field.html#SectionArg"><span class="hs-identifier hs-type">SectionArg</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-120"></span><span id="sectionArg"><span class="annot"><span class="annottext">sectionArg :: Parser (SectionArg Position)
</span><a href="Distribution.Fields.Parser.html#sectionArg"><span class="hs-identifier hs-var hs-var">sectionArg</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Parser (SectionArg Position)
</span><a href="Distribution.Fields.Parser.html#tokSym%27"><span class="hs-identifier hs-var">tokSym'</span></a></span><span> </span><span class="annot"><span class="annottext">Parser (SectionArg Position)
-&gt; Parser (SectionArg Position) -&gt; Parser (SectionArg Position)
forall (f :: * -&gt; *) a. Alternative f =&gt; f a -&gt; f a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Parser (SectionArg Position)
</span><a href="Distribution.Fields.Parser.html#tokStr"><span class="hs-identifier hs-var">tokStr</span></a></span><span> </span><span class="annot"><span class="annottext">Parser (SectionArg Position)
-&gt; Parser (SectionArg Position) -&gt; Parser (SectionArg Position)
forall (f :: * -&gt; *) a. Alternative f =&gt; f a -&gt; f a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Parser (SectionArg Position)
</span><a href="Distribution.Fields.Parser.html#tokOther"><span class="hs-identifier hs-var">tokOther</span></a></span><span> </span><span class="annot"><span class="annottext">Parser (SectionArg Position)
-&gt; [Char] -&gt; Parser (SectionArg Position)
forall s u (m :: * -&gt; *) a.
ParsecT s u m a -&gt; [Char] -&gt; ParsecT s u m a
</span><a href="../../parsec/src/Text.Parsec.Prim.html#%3C%3F%3E"><span class="hs-operator hs-var">&lt;?&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;section parameter&quot;</span></span><span>
</span><span id="line-121"></span><span>
</span><span id="line-122"></span><span class="annot"><a href="Distribution.Fields.Parser.html#fieldSecName"><span class="hs-identifier hs-type">fieldSecName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#Parser"><span class="hs-identifier hs-type">Parser</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Field.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-123"></span><span id="fieldSecName"><span class="annot"><span class="annottext">fieldSecName :: Parser (Name Position)
</span><a href="Distribution.Fields.Parser.html#fieldSecName"><span class="hs-identifier hs-var hs-var">fieldSecName</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Parser (Name Position)
</span><a href="Distribution.Fields.Parser.html#tokSym"><span class="hs-identifier hs-var">tokSym</span></a></span><span>              </span><span class="annot"><span class="annottext">Parser (Name Position) -&gt; [Char] -&gt; Parser (Name Position)
forall s u (m :: * -&gt; *) a.
ParsecT s u m a -&gt; [Char] -&gt; ParsecT s u m a
</span><a href="../../parsec/src/Text.Parsec.Prim.html#%3C%3F%3E"><span class="hs-operator hs-var">&lt;?&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;field or section name&quot;</span></span><span>
</span><span id="line-124"></span><span>
</span><span id="line-125"></span><span id="colon"><span class="annot"><span class="annottext">colon :: Parser ()
</span><a href="Distribution.Fields.Parser.html#colon"><span class="hs-identifier hs-var hs-var">colon</span></a></span></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Parser ()
</span><a href="Distribution.Fields.Parser.html#tokColon"><span class="hs-identifier hs-var">tokColon</span></a></span><span>      </span><span class="annot"><span class="annottext">Parser () -&gt; [Char] -&gt; Parser ()
forall s u (m :: * -&gt; *) a.
ParsecT s u m a -&gt; [Char] -&gt; ParsecT s u m a
</span><a href="../../parsec/src/Text.Parsec.Prim.html#%3C%3F%3E"><span class="hs-operator hs-var">&lt;?&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;\&quot;:\&quot;&quot;</span></span><span>
</span><span id="line-126"></span><span id="openBrace"><span class="annot"><span class="annottext">openBrace :: Parser ()
</span><a href="Distribution.Fields.Parser.html#openBrace"><span class="hs-identifier hs-var hs-var">openBrace</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Parser ()
</span><a href="Distribution.Fields.Parser.html#tokOpenBrace"><span class="hs-identifier hs-var">tokOpenBrace</span></a></span><span>  </span><span class="annot"><span class="annottext">Parser () -&gt; [Char] -&gt; Parser ()
forall s u (m :: * -&gt; *) a.
ParsecT s u m a -&gt; [Char] -&gt; ParsecT s u m a
</span><a href="../../parsec/src/Text.Parsec.Prim.html#%3C%3F%3E"><span class="hs-operator hs-var">&lt;?&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;\&quot;{\&quot;&quot;</span></span><span>
</span><span id="line-127"></span><span id="closeBrace"><span class="annot"><span class="annottext">closeBrace :: Parser ()
</span><a href="Distribution.Fields.Parser.html#closeBrace"><span class="hs-identifier hs-var hs-var">closeBrace</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Parser ()
</span><a href="Distribution.Fields.Parser.html#tokCloseBrace"><span class="hs-identifier hs-var">tokCloseBrace</span></a></span><span> </span><span class="annot"><span class="annottext">Parser () -&gt; [Char] -&gt; Parser ()
forall s u (m :: * -&gt; *) a.
ParsecT s u m a -&gt; [Char] -&gt; ParsecT s u m a
</span><a href="../../parsec/src/Text.Parsec.Prim.html#%3C%3F%3E"><span class="hs-operator hs-var">&lt;?&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;\&quot;}\&quot;&quot;</span></span><span>
</span><span id="line-128"></span><span>
</span><span id="line-129"></span><span class="annot"><a href="Distribution.Fields.Parser.html#fieldContent"><span class="hs-identifier hs-type">fieldContent</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#Parser"><span class="hs-identifier hs-type">Parser</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Field.html#FieldLine"><span class="hs-identifier hs-type">FieldLine</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-130"></span><span id="fieldContent"><span class="annot"><span class="annottext">fieldContent :: Parser (FieldLine Position)
</span><a href="Distribution.Fields.Parser.html#fieldContent"><span class="hs-identifier hs-var hs-var">fieldContent</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Parser (FieldLine Position)
</span><a href="Distribution.Fields.Parser.html#tokFieldLine"><span class="hs-identifier hs-var">tokFieldLine</span></a></span><span> </span><span class="annot"><span class="annottext">Parser (FieldLine Position)
-&gt; [Char] -&gt; Parser (FieldLine Position)
forall s u (m :: * -&gt; *) a.
ParsecT s u m a -&gt; [Char] -&gt; ParsecT s u m a
</span><a href="../../parsec/src/Text.Parsec.Prim.html#%3C%3F%3E"><span class="hs-operator hs-var">&lt;?&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;field contents&quot;</span></span><span>
</span><span id="line-131"></span><span>
</span><span id="line-132"></span><span class="hs-keyword">newtype</span><span> </span><span id="IndentLevel"><span class="annot"><a href="Distribution.Fields.Parser.html#IndentLevel"><span class="hs-identifier hs-var">IndentLevel</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="IndentLevel"><span class="annot"><a href="Distribution.Fields.Parser.html#IndentLevel"><span class="hs-identifier hs-var">IndentLevel</span></a></span></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-133"></span><span>
</span><span id="line-134"></span><span class="annot"><a href="Distribution.Fields.Parser.html#zeroIndentLevel"><span class="hs-identifier hs-type">zeroIndentLevel</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#IndentLevel"><span class="hs-identifier hs-type">IndentLevel</span></a></span><span>
</span><span id="line-135"></span><span id="zeroIndentLevel"><span class="annot"><span class="annottext">zeroIndentLevel :: IndentLevel
</span><a href="Distribution.Fields.Parser.html#zeroIndentLevel"><span class="hs-identifier hs-var hs-var">zeroIndentLevel</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; IndentLevel
</span><a href="Distribution.Fields.Parser.html#IndentLevel"><span class="hs-identifier hs-var">IndentLevel</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>
</span><span id="line-136"></span><span>
</span><span id="line-137"></span><span class="annot"><a href="Distribution.Fields.Parser.html#incIndentLevel"><span class="hs-identifier hs-type">incIndentLevel</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#IndentLevel"><span class="hs-identifier hs-type">IndentLevel</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#IndentLevel"><span class="hs-identifier hs-type">IndentLevel</span></a></span><span>
</span><span id="line-138"></span><span id="incIndentLevel"><span class="annot"><span class="annottext">incIndentLevel :: IndentLevel -&gt; IndentLevel
</span><a href="Distribution.Fields.Parser.html#incIndentLevel"><span class="hs-identifier hs-var hs-var">incIndentLevel</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Parser.html#IndentLevel"><span class="hs-identifier hs-type">IndentLevel</span></a></span><span> </span><span id="local-6989586621679623163"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679623163"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; IndentLevel
</span><a href="Distribution.Fields.Parser.html#IndentLevel"><span class="hs-identifier hs-var">IndentLevel</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Int
forall a. Enum a =&gt; a -&gt; a
</span><a href="../../base/src/GHC.Enum.html#succ"><span class="hs-identifier hs-var">succ</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679623163"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-139"></span><span>
</span><span id="line-140"></span><span class="annot"><a href="Distribution.Fields.Parser.html#indentOfAtLeast"><span class="hs-identifier hs-type">indentOfAtLeast</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#IndentLevel"><span class="hs-identifier hs-type">IndentLevel</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#Parser"><span class="hs-identifier hs-type">Parser</span></a></span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#IndentLevel"><span class="hs-identifier hs-type">IndentLevel</span></a></span><span>
</span><span id="line-141"></span><span id="indentOfAtLeast"><span class="annot"><span class="annottext">indentOfAtLeast :: IndentLevel -&gt; Parser IndentLevel
</span><a href="Distribution.Fields.Parser.html#indentOfAtLeast"><span class="hs-identifier hs-var hs-var">indentOfAtLeast</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Parser.html#IndentLevel"><span class="hs-identifier hs-type">IndentLevel</span></a></span><span> </span><span id="local-6989586621679623160"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679623160"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Parser IndentLevel -&gt; Parser IndentLevel
forall s u (m :: * -&gt; *) a. ParsecT s u m a -&gt; ParsecT s u m a
</span><a href="../../parsec/src/Text.Parsec.Prim.html#try"><span class="hs-identifier hs-var">try</span></a></span><span> </span><span class="annot"><span class="annottext">(Parser IndentLevel -&gt; Parser IndentLevel)
-&gt; Parser IndentLevel -&gt; Parser IndentLevel
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-142"></span><span>  </span><span id="local-6989586621679623158"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679623158"><span class="hs-identifier hs-var">j</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Parser Int
</span><a href="Distribution.Fields.Parser.html#tokIndent"><span class="hs-identifier hs-var">tokIndent</span></a></span><span>
</span><span id="line-143"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; Parser ()
forall (f :: * -&gt; *). Alternative f =&gt; Bool -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#guard"><span class="hs-identifier hs-var">guard</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679623158"><span class="hs-identifier hs-var">j</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679623160"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Parser () -&gt; [Char] -&gt; Parser ()
forall s u (m :: * -&gt; *) a.
ParsecT s u m a -&gt; [Char] -&gt; ParsecT s u m a
</span><a href="../../parsec/src/Text.Parsec.Prim.html#%3C%3F%3E"><span class="hs-operator hs-var">&lt;?&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;indentation of at least &quot;</span></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; [Char]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; [Char]
forall a. Show a =&gt; a -&gt; [Char]
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679623160"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-144"></span><span>  </span><span class="annot"><span class="annottext">IndentLevel -&gt; Parser IndentLevel
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; IndentLevel
</span><a href="Distribution.Fields.Parser.html#IndentLevel"><span class="hs-identifier hs-var">IndentLevel</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679623158"><span class="hs-identifier hs-var">j</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-145"></span><span>
</span><span id="line-146"></span><span>
</span><span id="line-147"></span><span class="hs-keyword">newtype</span><span> </span><span id="LexerMode"><span class="annot"><a href="Distribution.Fields.Parser.html#LexerMode"><span class="hs-identifier hs-var">LexerMode</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="LexerMode"><span class="annot"><a href="Distribution.Fields.Parser.html#LexerMode"><span class="hs-identifier hs-var">LexerMode</span></a></span></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-148"></span><span>
</span><span id="line-149"></span><span id="local-6989586621679623409"><span class="annot"><a href="Distribution.Fields.Parser.html#inLexerMode"><span class="hs-identifier hs-type">inLexerMode</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#LexerMode"><span class="hs-identifier hs-type">LexerMode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#Parser"><span class="hs-identifier hs-type">Parser</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679623409"><span class="hs-identifier hs-type">p</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#Parser"><span class="hs-identifier hs-type">Parser</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679623409"><span class="hs-identifier hs-type">p</span></a></span></span><span>
</span><span id="line-150"></span><span id="inLexerMode"><span class="annot"><span class="annottext">inLexerMode :: forall p. LexerMode -&gt; Parser p -&gt; Parser p
</span><a href="Distribution.Fields.Parser.html#inLexerMode"><span class="hs-identifier hs-var hs-var">inLexerMode</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Parser.html#LexerMode"><span class="hs-identifier hs-type">LexerMode</span></a></span><span> </span><span id="local-6989586621679623151"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679623151"><span class="hs-identifier hs-var">mode</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679623150"><span class="annot"><span class="annottext">Parser p
</span><a href="#local-6989586621679623150"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-151"></span><span>  </span><span class="hs-keyword">do</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Parser ()
</span><a href="Distribution.Fields.Parser.html#setLexerMode"><span class="hs-identifier hs-var">setLexerMode</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679623151"><span class="hs-identifier hs-var">mode</span></a></span><span class="hs-special">;</span><span> </span><span id="local-6989586621679623149"><span class="annot"><span class="annottext">p
</span><a href="#local-6989586621679623149"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Parser p
</span><a href="#local-6989586621679623150"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Parser ()
</span><a href="Distribution.Fields.Parser.html#setLexerMode"><span class="hs-identifier hs-var">setLexerMode</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="Distribution.Fields.Lexer.html#in_section"><span class="hs-identifier hs-var">in_section</span></a></span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">p -&gt; Parser p
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">p
</span><a href="#local-6989586621679623149"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-152"></span><span>
</span><span id="line-153"></span><span>
</span><span id="line-154"></span><span class="hs-comment">-----------------------</span><span>
</span><span id="line-155"></span><span class="hs-comment">-- Cabal file grammar</span><span>
</span><span id="line-156"></span><span class="hs-comment">--</span><span>
</span><span id="line-157"></span><span>
</span><span id="line-158"></span><span class="hs-comment">-- $grammar</span><span>
</span><span id="line-159"></span><span class="hs-comment">--</span><span>
</span><span id="line-160"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-161"></span><span class="hs-comment">-- CabalStyleFile ::= SecElems</span><span>
</span><span id="line-162"></span><span class="hs-comment">--</span><span>
</span><span id="line-163"></span><span class="hs-comment">-- SecElems       ::= SecElem* '\\n'?</span><span>
</span><span id="line-164"></span><span class="hs-comment">-- SecElem        ::= '\\n' SecElemLayout | SecElemBraces</span><span>
</span><span id="line-165"></span><span class="hs-comment">-- SecElemLayout  ::= FieldLayout | FieldBraces | SectionLayout | SectionBraces</span><span>
</span><span id="line-166"></span><span class="hs-comment">-- SecElemBraces  ::= FieldInline | FieldBraces |                 SectionBraces</span><span>
</span><span id="line-167"></span><span class="hs-comment">-- FieldLayout    ::= name ':' line? ('\\n' line)*</span><span>
</span><span id="line-168"></span><span class="hs-comment">-- FieldBraces    ::= name ':' '\\n'? '{' content '}'</span><span>
</span><span id="line-169"></span><span class="hs-comment">-- FieldInline    ::= name ':' content</span><span>
</span><span id="line-170"></span><span class="hs-comment">-- SectionLayout  ::= name arg* SecElems</span><span>
</span><span id="line-171"></span><span class="hs-comment">-- SectionBraces  ::= name arg* '\\n'? '{' SecElems '}'</span><span>
</span><span id="line-172"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-173"></span><span class="hs-comment">--</span><span>
</span><span id="line-174"></span><span class="hs-comment">-- and the same thing but left factored...</span><span>
</span><span id="line-175"></span><span class="hs-comment">--</span><span>
</span><span id="line-176"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-177"></span><span class="hs-comment">-- SecElems              ::= SecElem*</span><span>
</span><span id="line-178"></span><span class="hs-comment">-- SecElem               ::= '\\n' name SecElemLayout</span><span>
</span><span id="line-179"></span><span class="hs-comment">--                         |      name SecElemBraces</span><span>
</span><span id="line-180"></span><span class="hs-comment">-- SecElemLayout         ::= ':'   FieldLayoutOrBraces</span><span>
</span><span id="line-181"></span><span class="hs-comment">--                         | arg*  SectionLayoutOrBraces</span><span>
</span><span id="line-182"></span><span class="hs-comment">-- FieldLayoutOrBraces   ::= '\\n'? '{' content '}'</span><span>
</span><span id="line-183"></span><span class="hs-comment">--                         | line? ('\\n' line)*</span><span>
</span><span id="line-184"></span><span class="hs-comment">-- SectionLayoutOrBraces ::= '\\n'? '{' SecElems '\\n'? '}'</span><span>
</span><span id="line-185"></span><span class="hs-comment">--                         | SecElems</span><span>
</span><span id="line-186"></span><span class="hs-comment">-- SecElemBraces         ::= ':' FieldInlineOrBraces</span><span>
</span><span id="line-187"></span><span class="hs-comment">--                         | arg* '\\n'? '{' SecElems '\\n'? '}'</span><span>
</span><span id="line-188"></span><span class="hs-comment">-- FieldInlineOrBraces   ::= '\\n'? '{' content '}'</span><span>
</span><span id="line-189"></span><span class="hs-comment">--                         | content</span><span>
</span><span id="line-190"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-191"></span><span class="hs-comment">--</span><span>
</span><span id="line-192"></span><span class="hs-comment">-- Note how we have several productions with the sequence:</span><span>
</span><span id="line-193"></span><span class="hs-comment">--</span><span>
</span><span id="line-194"></span><span class="hs-comment">-- &gt; '\\n'? '{'</span><span>
</span><span id="line-195"></span><span class="hs-comment">--</span><span>
</span><span id="line-196"></span><span class="hs-comment">-- That is, an optional newline (and indent) followed by a @{@ token.</span><span>
</span><span id="line-197"></span><span class="hs-comment">-- In the @SectionLayoutOrBraces@ case you can see that this makes it</span><span>
</span><span id="line-198"></span><span class="hs-comment">-- not fully left factored (because @SecElems@ can start with a @\\n@).</span><span>
</span><span id="line-199"></span><span class="hs-comment">-- Fully left factoring here would be ugly, and though we could use a</span><span>
</span><span id="line-200"></span><span class="hs-comment">-- lookahead of two tokens to resolve the alternatives, we can't</span><span>
</span><span id="line-201"></span><span class="hs-comment">-- conveniently use Parsec's 'try' here to get a lookahead of only two.</span><span>
</span><span id="line-202"></span><span class="hs-comment">-- So instead we deal with this case in the lexer by making a line</span><span>
</span><span id="line-203"></span><span class="hs-comment">-- where the first non-space is @{@ lex as just the @{@ token, without</span><span>
</span><span id="line-204"></span><span class="hs-comment">-- the usual indent token. Then in the parser we can resolve everything</span><span>
</span><span id="line-205"></span><span class="hs-comment">-- with just one token of lookahead and so without using 'try'.</span><span>
</span><span id="line-206"></span><span>
</span><span id="line-207"></span><span class="hs-comment">-- Top level of a file using cabal syntax</span><span>
</span><span id="line-208"></span><span class="hs-comment">--</span><span>
</span><span id="line-209"></span><span class="annot"><a href="Distribution.Fields.Parser.html#cabalStyleFile"><span class="hs-identifier hs-type">cabalStyleFile</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#Parser"><span class="hs-identifier hs-type">Parser</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-type">Field</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-210"></span><span id="cabalStyleFile"><span class="annot"><span class="annottext">cabalStyleFile :: Parser [Field Position]
</span><a href="Distribution.Fields.Parser.html#cabalStyleFile"><span class="hs-identifier hs-var hs-var">cabalStyleFile</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621679623146"><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679623146"><span class="hs-identifier hs-var">es</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IndentLevel -&gt; Parser [Field Position]
</span><a href="Distribution.Fields.Parser.html#elements"><span class="hs-identifier hs-var">elements</span></a></span><span> </span><span class="annot"><span class="annottext">IndentLevel
</span><a href="Distribution.Fields.Parser.html#zeroIndentLevel"><span class="hs-identifier hs-var">zeroIndentLevel</span></a></span><span>
</span><span id="line-211"></span><span>                    </span><span class="annot"><span class="annottext">Parser ()
</span><a href="Distribution.Fields.Parser.html#eof"><span class="hs-identifier hs-var">eof</span></a></span><span>
</span><span id="line-212"></span><span>                    </span><span class="annot"><span class="annottext">[Field Position] -&gt; Parser [Field Position]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679623146"><span class="hs-identifier hs-var">es</span></a></span><span>
</span><span id="line-213"></span><span>
</span><span id="line-214"></span><span class="hs-comment">-- Elements that live at the top level or inside a section, ie fields</span><span>
</span><span id="line-215"></span><span class="hs-comment">-- and sectionscontent</span><span>
</span><span id="line-216"></span><span class="hs-comment">--</span><span>
</span><span id="line-217"></span><span class="hs-comment">-- elements ::= element*</span><span>
</span><span id="line-218"></span><span class="annot"><a href="Distribution.Fields.Parser.html#elements"><span class="hs-identifier hs-type">elements</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#IndentLevel"><span class="hs-identifier hs-type">IndentLevel</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#Parser"><span class="hs-identifier hs-type">Parser</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-type">Field</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-219"></span><span id="elements"><span class="annot"><span class="annottext">elements :: IndentLevel -&gt; Parser [Field Position]
</span><a href="Distribution.Fields.Parser.html#elements"><span class="hs-identifier hs-var hs-var">elements</span></a></span></span><span> </span><span id="local-6989586621679623143"><span class="annot"><span class="annottext">IndentLevel
</span><a href="#local-6989586621679623143"><span class="hs-identifier hs-var">ilevel</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParsecT LexState' () Identity (Field Position)
-&gt; Parser [Field Position]
forall (f :: * -&gt; *) a. Alternative f =&gt; f a -&gt; f [a]
</span><a href="../../base/src/GHC.Base.html#many"><span class="hs-identifier hs-var">many</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IndentLevel -&gt; ParsecT LexState' () Identity (Field Position)
</span><a href="Distribution.Fields.Parser.html#element"><span class="hs-identifier hs-var">element</span></a></span><span> </span><span class="annot"><span class="annottext">IndentLevel
</span><a href="#local-6989586621679623143"><span class="hs-identifier hs-var">ilevel</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-220"></span><span>
</span><span id="line-221"></span><span class="hs-comment">-- An individual element, ie a field or a section. These can either use</span><span>
</span><span id="line-222"></span><span class="hs-comment">-- layout style or braces style. For layout style then it must start on</span><span>
</span><span id="line-223"></span><span class="hs-comment">-- a line on its own (so that we know its indentation level).</span><span>
</span><span id="line-224"></span><span class="hs-comment">--</span><span>
</span><span id="line-225"></span><span class="hs-comment">-- element ::= '\\n' name elementInLayoutContext</span><span>
</span><span id="line-226"></span><span class="hs-comment">--           |      name elementInNonLayoutContext</span><span>
</span><span id="line-227"></span><span class="annot"><a href="Distribution.Fields.Parser.html#element"><span class="hs-identifier hs-type">element</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#IndentLevel"><span class="hs-identifier hs-type">IndentLevel</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#Parser"><span class="hs-identifier hs-type">Parser</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-type">Field</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-228"></span><span id="element"><span class="annot"><span class="annottext">element :: IndentLevel -&gt; ParsecT LexState' () Identity (Field Position)
</span><a href="Distribution.Fields.Parser.html#element"><span class="hs-identifier hs-var hs-var">element</span></a></span></span><span> </span><span id="local-6989586621679623140"><span class="annot"><span class="annottext">IndentLevel
</span><a href="#local-6989586621679623140"><span class="hs-identifier hs-var">ilevel</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-229"></span><span>      </span><span class="hs-special">(</span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621679623139"><span class="annot"><span class="annottext">IndentLevel
</span><a href="#local-6989586621679623139"><span class="hs-identifier hs-var">ilevel'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IndentLevel -&gt; Parser IndentLevel
</span><a href="Distribution.Fields.Parser.html#indentOfAtLeast"><span class="hs-identifier hs-var">indentOfAtLeast</span></a></span><span> </span><span class="annot"><span class="annottext">IndentLevel
</span><a href="#local-6989586621679623140"><span class="hs-identifier hs-var">ilevel</span></a></span><span>
</span><span id="line-230"></span><span>          </span><span id="local-6989586621679623138"><span class="annot"><span class="annottext">Name Position
</span><a href="#local-6989586621679623138"><span class="hs-identifier hs-var">name</span></a></span></span><span>    </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Parser (Name Position)
</span><a href="Distribution.Fields.Parser.html#fieldSecName"><span class="hs-identifier hs-var">fieldSecName</span></a></span><span>
</span><span id="line-231"></span><span>          </span><span class="annot"><span class="annottext">IndentLevel
-&gt; Name Position -&gt; ParsecT LexState' () Identity (Field Position)
</span><a href="Distribution.Fields.Parser.html#elementInLayoutContext"><span class="hs-identifier hs-var">elementInLayoutContext</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IndentLevel -&gt; IndentLevel
</span><a href="Distribution.Fields.Parser.html#incIndentLevel"><span class="hs-identifier hs-var">incIndentLevel</span></a></span><span> </span><span class="annot"><span class="annottext">IndentLevel
</span><a href="#local-6989586621679623139"><span class="hs-identifier hs-var">ilevel'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Name Position
</span><a href="#local-6989586621679623138"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-232"></span><span>  </span><span class="annot"><span class="annottext">ParsecT LexState' () Identity (Field Position)
-&gt; ParsecT LexState' () Identity (Field Position)
-&gt; ParsecT LexState' () Identity (Field Position)
forall (f :: * -&gt; *) a. Alternative f =&gt; f a -&gt; f a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621679623136"><span class="annot"><span class="annottext">Name Position
</span><a href="#local-6989586621679623136"><span class="hs-identifier hs-var">name</span></a></span></span><span>    </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Parser (Name Position)
</span><a href="Distribution.Fields.Parser.html#fieldSecName"><span class="hs-identifier hs-var">fieldSecName</span></a></span><span>
</span><span id="line-233"></span><span>          </span><span class="annot"><span class="annottext">Name Position -&gt; ParsecT LexState' () Identity (Field Position)
</span><a href="Distribution.Fields.Parser.html#elementInNonLayoutContext"><span class="hs-identifier hs-var">elementInNonLayoutContext</span></a></span><span> </span><span class="annot"><span class="annottext">Name Position
</span><a href="#local-6989586621679623136"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-234"></span><span>
</span><span id="line-235"></span><span class="hs-comment">-- An element (field or section) that is valid in a layout context.</span><span>
</span><span id="line-236"></span><span class="hs-comment">-- In a layout context we can have fields and sections that themselves</span><span>
</span><span id="line-237"></span><span class="hs-comment">-- either use layout style or that use braces style.</span><span>
</span><span id="line-238"></span><span class="hs-comment">--</span><span>
</span><span id="line-239"></span><span class="hs-comment">-- elementInLayoutContext ::= ':'  fieldLayoutOrBraces</span><span>
</span><span id="line-240"></span><span class="hs-comment">--                          | arg* sectionLayoutOrBraces</span><span>
</span><span id="line-241"></span><span class="annot"><a href="Distribution.Fields.Parser.html#elementInLayoutContext"><span class="hs-identifier hs-type">elementInLayoutContext</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#IndentLevel"><span class="hs-identifier hs-type">IndentLevel</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.Field.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#Parser"><span class="hs-identifier hs-type">Parser</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-type">Field</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-242"></span><span id="elementInLayoutContext"><span class="annot"><span class="annottext">elementInLayoutContext :: IndentLevel
-&gt; Name Position -&gt; ParsecT LexState' () Identity (Field Position)
</span><a href="Distribution.Fields.Parser.html#elementInLayoutContext"><span class="hs-identifier hs-var hs-var">elementInLayoutContext</span></a></span></span><span> </span><span id="local-6989586621679623134"><span class="annot"><span class="annottext">IndentLevel
</span><a href="#local-6989586621679623134"><span class="hs-identifier hs-var">ilevel</span></a></span></span><span> </span><span id="local-6989586621679623133"><span class="annot"><span class="annottext">Name Position
</span><a href="#local-6989586621679623133"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-243"></span><span>      </span><span class="hs-special">(</span><span class="hs-keyword">do</span><span> </span><span class="annot"><span class="annottext">Parser ()
</span><a href="Distribution.Fields.Parser.html#colon"><span class="hs-identifier hs-var">colon</span></a></span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">IndentLevel
-&gt; Name Position -&gt; ParsecT LexState' () Identity (Field Position)
</span><a href="Distribution.Fields.Parser.html#fieldLayoutOrBraces"><span class="hs-identifier hs-var">fieldLayoutOrBraces</span></a></span><span> </span><span class="annot"><span class="annottext">IndentLevel
</span><a href="#local-6989586621679623134"><span class="hs-identifier hs-var">ilevel</span></a></span><span> </span><span class="annot"><span class="annottext">Name Position
</span><a href="#local-6989586621679623133"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-244"></span><span>  </span><span class="annot"><span class="annottext">ParsecT LexState' () Identity (Field Position)
-&gt; ParsecT LexState' () Identity (Field Position)
-&gt; ParsecT LexState' () Identity (Field Position)
forall (f :: * -&gt; *) a. Alternative f =&gt; f a -&gt; f a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621679623131"><span class="annot"><span class="annottext">[SectionArg Position]
</span><a href="#local-6989586621679623131"><span class="hs-identifier hs-var">args</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Parser (SectionArg Position)
-&gt; ParsecT LexState' () Identity [SectionArg Position]
forall (f :: * -&gt; *) a. Alternative f =&gt; f a -&gt; f [a]
</span><a href="../../base/src/GHC.Base.html#many"><span class="hs-identifier hs-var">many</span></a></span><span> </span><span class="annot"><span class="annottext">Parser (SectionArg Position)
</span><a href="Distribution.Fields.Parser.html#sectionArg"><span class="hs-identifier hs-var">sectionArg</span></a></span><span>
</span><span id="line-245"></span><span>          </span><span id="local-6989586621679623130"><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679623130"><span class="hs-identifier hs-var">elems</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IndentLevel -&gt; Parser [Field Position]
</span><a href="Distribution.Fields.Parser.html#sectionLayoutOrBraces"><span class="hs-identifier hs-var">sectionLayoutOrBraces</span></a></span><span> </span><span class="annot"><span class="annottext">IndentLevel
</span><a href="#local-6989586621679623134"><span class="hs-identifier hs-var">ilevel</span></a></span><span>
</span><span id="line-246"></span><span>          </span><span class="annot"><span class="annottext">Field Position -&gt; ParsecT LexState' () Identity (Field Position)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name Position
-&gt; [SectionArg Position] -&gt; [Field Position] -&gt; Field Position
forall ann.
Name ann -&gt; [SectionArg ann] -&gt; [Field ann] -&gt; Field ann
</span><a href="Distribution.Fields.Field.html#Section"><span class="hs-identifier hs-var">Section</span></a></span><span> </span><span class="annot"><span class="annottext">Name Position
</span><a href="#local-6989586621679623133"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">[SectionArg Position]
</span><a href="#local-6989586621679623131"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679623130"><span class="hs-identifier hs-var">elems</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-247"></span><span>
</span><span id="line-248"></span><span class="hs-comment">-- An element (field or section) that is valid in a non-layout context.</span><span>
</span><span id="line-249"></span><span class="hs-comment">-- In a non-layout context we can have only have fields and sections that</span><span>
</span><span id="line-250"></span><span class="hs-comment">-- themselves use braces style, or inline style fields.</span><span>
</span><span id="line-251"></span><span class="hs-comment">--</span><span>
</span><span id="line-252"></span><span class="hs-comment">-- elementInNonLayoutContext ::= ':' FieldInlineOrBraces</span><span>
</span><span id="line-253"></span><span class="hs-comment">--                             | arg* '\\n'? '{' elements '\\n'? '}'</span><span>
</span><span id="line-254"></span><span class="annot"><a href="Distribution.Fields.Parser.html#elementInNonLayoutContext"><span class="hs-identifier hs-type">elementInNonLayoutContext</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Fields.Field.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#Parser"><span class="hs-identifier hs-type">Parser</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-type">Field</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-255"></span><span id="elementInNonLayoutContext"><span class="annot"><span class="annottext">elementInNonLayoutContext :: Name Position -&gt; ParsecT LexState' () Identity (Field Position)
</span><a href="Distribution.Fields.Parser.html#elementInNonLayoutContext"><span class="hs-identifier hs-var hs-var">elementInNonLayoutContext</span></a></span></span><span> </span><span id="local-6989586621679623127"><span class="annot"><span class="annottext">Name Position
</span><a href="#local-6989586621679623127"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-256"></span><span>      </span><span class="hs-special">(</span><span class="hs-keyword">do</span><span> </span><span class="annot"><span class="annottext">Parser ()
</span><a href="Distribution.Fields.Parser.html#colon"><span class="hs-identifier hs-var">colon</span></a></span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Name Position -&gt; ParsecT LexState' () Identity (Field Position)
</span><a href="Distribution.Fields.Parser.html#fieldInlineOrBraces"><span class="hs-identifier hs-var">fieldInlineOrBraces</span></a></span><span> </span><span class="annot"><span class="annottext">Name Position
</span><a href="#local-6989586621679623127"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-257"></span><span>  </span><span class="annot"><span class="annottext">ParsecT LexState' () Identity (Field Position)
-&gt; ParsecT LexState' () Identity (Field Position)
-&gt; ParsecT LexState' () Identity (Field Position)
forall (f :: * -&gt; *) a. Alternative f =&gt; f a -&gt; f a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621679623125"><span class="annot"><span class="annottext">[SectionArg Position]
</span><a href="#local-6989586621679623125"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Parser (SectionArg Position)
-&gt; ParsecT LexState' () Identity [SectionArg Position]
forall (f :: * -&gt; *) a. Alternative f =&gt; f a -&gt; f [a]
</span><a href="../../base/src/GHC.Base.html#many"><span class="hs-identifier hs-var">many</span></a></span><span> </span><span class="annot"><span class="annottext">Parser (SectionArg Position)
</span><a href="Distribution.Fields.Parser.html#sectionArg"><span class="hs-identifier hs-var">sectionArg</span></a></span><span>
</span><span id="line-258"></span><span>          </span><span class="annot"><span class="annottext">Parser ()
</span><a href="Distribution.Fields.Parser.html#openBrace"><span class="hs-identifier hs-var">openBrace</span></a></span><span>
</span><span id="line-259"></span><span>          </span><span id="local-6989586621679623124"><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679623124"><span class="hs-identifier hs-var">elems</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IndentLevel -&gt; Parser [Field Position]
</span><a href="Distribution.Fields.Parser.html#elements"><span class="hs-identifier hs-var">elements</span></a></span><span> </span><span class="annot"><span class="annottext">IndentLevel
</span><a href="Distribution.Fields.Parser.html#zeroIndentLevel"><span class="hs-identifier hs-var">zeroIndentLevel</span></a></span><span>
</span><span id="line-260"></span><span>          </span><span class="annot"><span class="annottext">Parser Int -&gt; Parser ()
forall s (m :: * -&gt; *) t u a.
Stream s m t =&gt;
ParsecT s u m a -&gt; ParsecT s u m ()
</span><a href="../../parsec/src/Text.Parsec.Combinator.html#optional"><span class="hs-identifier hs-var">optional</span></a></span><span> </span><span class="annot"><span class="annottext">Parser Int
</span><a href="Distribution.Fields.Parser.html#tokIndent"><span class="hs-identifier hs-var">tokIndent</span></a></span><span>
</span><span id="line-261"></span><span>          </span><span class="annot"><span class="annottext">Parser ()
</span><a href="Distribution.Fields.Parser.html#closeBrace"><span class="hs-identifier hs-var">closeBrace</span></a></span><span>
</span><span id="line-262"></span><span>          </span><span class="annot"><span class="annottext">Field Position -&gt; ParsecT LexState' () Identity (Field Position)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name Position
-&gt; [SectionArg Position] -&gt; [Field Position] -&gt; Field Position
forall ann.
Name ann -&gt; [SectionArg ann] -&gt; [Field ann] -&gt; Field ann
</span><a href="Distribution.Fields.Field.html#Section"><span class="hs-identifier hs-var">Section</span></a></span><span> </span><span class="annot"><span class="annottext">Name Position
</span><a href="#local-6989586621679623127"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">[SectionArg Position]
</span><a href="#local-6989586621679623125"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679623124"><span class="hs-identifier hs-var">elems</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-263"></span><span>
</span><span id="line-264"></span><span class="hs-comment">-- The body of a field, using either layout style or braces style.</span><span>
</span><span id="line-265"></span><span class="hs-comment">--</span><span>
</span><span id="line-266"></span><span class="hs-comment">-- fieldLayoutOrBraces   ::= '\\n'? '{' content '}'</span><span>
</span><span id="line-267"></span><span class="hs-comment">--                         | line? ('\\n' line)*</span><span>
</span><span id="line-268"></span><span class="annot"><a href="Distribution.Fields.Parser.html#fieldLayoutOrBraces"><span class="hs-identifier hs-type">fieldLayoutOrBraces</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#IndentLevel"><span class="hs-identifier hs-type">IndentLevel</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.Field.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#Parser"><span class="hs-identifier hs-type">Parser</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-type">Field</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-269"></span><span id="fieldLayoutOrBraces"><span class="annot"><span class="annottext">fieldLayoutOrBraces :: IndentLevel
-&gt; Name Position -&gt; ParsecT LexState' () Identity (Field Position)
</span><a href="Distribution.Fields.Parser.html#fieldLayoutOrBraces"><span class="hs-identifier hs-var hs-var">fieldLayoutOrBraces</span></a></span></span><span> </span><span id="local-6989586621679623122"><span class="annot"><span class="annottext">IndentLevel
</span><a href="#local-6989586621679623122"><span class="hs-identifier hs-var">ilevel</span></a></span></span><span> </span><span id="local-6989586621679623121"><span class="annot"><span class="annottext">Name Position
</span><a href="#local-6989586621679623121"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ParsecT LexState' () Identity (Field Position)
</span><a href="#local-6989586621679623120"><span class="hs-identifier hs-var">braces</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecT LexState' () Identity (Field Position)
-&gt; ParsecT LexState' () Identity (Field Position)
-&gt; ParsecT LexState' () Identity (Field Position)
forall (f :: * -&gt; *) a. Alternative f =&gt; f a -&gt; f a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecT LexState' () Identity (Field Position)
</span><a href="#local-6989586621679623119"><span class="hs-identifier hs-var">fieldLayout</span></a></span><span>
</span><span id="line-270"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-271"></span><span>    </span><span id="local-6989586621679623120"><span class="annot"><span class="annottext">braces :: ParsecT LexState' () Identity (Field Position)
</span><a href="#local-6989586621679623120"><span class="hs-identifier hs-var hs-var">braces</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-272"></span><span>          </span><span class="annot"><span class="annottext">Parser ()
</span><a href="Distribution.Fields.Parser.html#openBrace"><span class="hs-identifier hs-var">openBrace</span></a></span><span>
</span><span id="line-273"></span><span>          </span><span id="local-6989586621679623113"><span class="annot"><span class="annottext">[FieldLine Position]
</span><a href="#local-6989586621679623113"><span class="hs-identifier hs-var">ls</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LexerMode
-&gt; Parser [FieldLine Position] -&gt; Parser [FieldLine Position]
forall p. LexerMode -&gt; Parser p -&gt; Parser p
</span><a href="Distribution.Fields.Parser.html#inLexerMode"><span class="hs-identifier hs-var">inLexerMode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; LexerMode
</span><a href="Distribution.Fields.Parser.html#LexerMode"><span class="hs-identifier hs-var">LexerMode</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="Distribution.Fields.Lexer.html#in_field_braces"><span class="hs-identifier hs-var">in_field_braces</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Parser (FieldLine Position) -&gt; Parser [FieldLine Position]
forall (f :: * -&gt; *) a. Alternative f =&gt; f a -&gt; f [a]
</span><a href="../../base/src/GHC.Base.html#many"><span class="hs-identifier hs-var">many</span></a></span><span> </span><span class="annot"><span class="annottext">Parser (FieldLine Position)
</span><a href="Distribution.Fields.Parser.html#fieldContent"><span class="hs-identifier hs-var">fieldContent</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-274"></span><span>          </span><span class="annot"><span class="annottext">Parser ()
</span><a href="Distribution.Fields.Parser.html#closeBrace"><span class="hs-identifier hs-var">closeBrace</span></a></span><span>
</span><span id="line-275"></span><span>          </span><span class="annot"><span class="annottext">Field Position -&gt; ParsecT LexState' () Identity (Field Position)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name Position -&gt; [FieldLine Position] -&gt; Field Position
forall ann. Name ann -&gt; [FieldLine ann] -&gt; Field ann
</span><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-var">Field</span></a></span><span> </span><span class="annot"><span class="annottext">Name Position
</span><a href="#local-6989586621679623121"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">[FieldLine Position]
</span><a href="#local-6989586621679623113"><span class="hs-identifier hs-var">ls</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-276"></span><span>    </span><span id="local-6989586621679623119"><span class="annot"><span class="annottext">fieldLayout :: ParsecT LexState' () Identity (Field Position)
</span><a href="#local-6989586621679623119"><span class="hs-identifier hs-var hs-var">fieldLayout</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LexerMode
-&gt; ParsecT LexState' () Identity (Field Position)
-&gt; ParsecT LexState' () Identity (Field Position)
forall p. LexerMode -&gt; Parser p -&gt; Parser p
</span><a href="Distribution.Fields.Parser.html#inLexerMode"><span class="hs-identifier hs-var">inLexerMode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; LexerMode
</span><a href="Distribution.Fields.Parser.html#LexerMode"><span class="hs-identifier hs-var">LexerMode</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="Distribution.Fields.Lexer.html#in_field_layout"><span class="hs-identifier hs-var">in_field_layout</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(ParsecT LexState' () Identity (Field Position)
 -&gt; ParsecT LexState' () Identity (Field Position))
-&gt; ParsecT LexState' () Identity (Field Position)
-&gt; ParsecT LexState' () Identity (Field Position)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-277"></span><span>          </span><span id="local-6989586621679623103"><span class="annot"><span class="annottext">Maybe (FieldLine Position)
</span><a href="#local-6989586621679623103"><span class="hs-identifier hs-var">l</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Parser (FieldLine Position)
-&gt; ParsecT LexState' () Identity (Maybe (FieldLine Position))
forall s (m :: * -&gt; *) t u a.
Stream s m t =&gt;
ParsecT s u m a -&gt; ParsecT s u m (Maybe a)
</span><a href="../../parsec/src/Text.Parsec.Combinator.html#optionMaybe"><span class="hs-identifier hs-var">optionMaybe</span></a></span><span> </span><span class="annot"><span class="annottext">Parser (FieldLine Position)
</span><a href="Distribution.Fields.Parser.html#fieldContent"><span class="hs-identifier hs-var">fieldContent</span></a></span><span>
</span><span id="line-278"></span><span>          </span><span id="local-6989586621679623101"><span class="annot"><span class="annottext">[FieldLine Position]
</span><a href="#local-6989586621679623101"><span class="hs-identifier hs-var">ls</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Parser (FieldLine Position) -&gt; Parser [FieldLine Position]
forall (f :: * -&gt; *) a. Alternative f =&gt; f a -&gt; f [a]
</span><a href="../../base/src/GHC.Base.html#many"><span class="hs-identifier hs-var">many</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-keyword">do</span><span> </span><span class="annot"><span class="annottext">IndentLevel
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IndentLevel -&gt; Parser IndentLevel
</span><a href="Distribution.Fields.Parser.html#indentOfAtLeast"><span class="hs-identifier hs-var">indentOfAtLeast</span></a></span><span> </span><span class="annot"><span class="annottext">IndentLevel
</span><a href="#local-6989586621679623122"><span class="hs-identifier hs-var">ilevel</span></a></span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Parser (FieldLine Position)
</span><a href="Distribution.Fields.Parser.html#fieldContent"><span class="hs-identifier hs-var">fieldContent</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-279"></span><span>          </span><span class="annot"><span class="annottext">Field Position -&gt; ParsecT LexState' () Identity (Field Position)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Field Position -&gt; ParsecT LexState' () Identity (Field Position))
-&gt; Field Position -&gt; ParsecT LexState' () Identity (Field Position)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe (FieldLine Position)
</span><a href="#local-6989586621679623103"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-280"></span><span>              </span><span class="annot"><span class="annottext">Maybe (FieldLine Position)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Name Position -&gt; [FieldLine Position] -&gt; Field Position
forall ann. Name ann -&gt; [FieldLine ann] -&gt; Field ann
</span><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-var">Field</span></a></span><span> </span><span class="annot"><span class="annottext">Name Position
</span><a href="#local-6989586621679623121"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">[FieldLine Position]
</span><a href="#local-6989586621679623101"><span class="hs-identifier hs-var">ls</span></a></span><span>
</span><span id="line-281"></span><span>              </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679623100"><span class="annot"><span class="annottext">FieldLine Position
</span><a href="#local-6989586621679623100"><span class="hs-identifier hs-var">l'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Name Position -&gt; [FieldLine Position] -&gt; Field Position
forall ann. Name ann -&gt; [FieldLine ann] -&gt; Field ann
</span><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-var">Field</span></a></span><span> </span><span class="annot"><span class="annottext">Name Position
</span><a href="#local-6989586621679623121"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FieldLine Position
</span><a href="#local-6989586621679623100"><span class="hs-identifier hs-var">l'</span></a></span><span> </span><span class="annot"><span class="annottext">FieldLine Position -&gt; [FieldLine Position] -&gt; [FieldLine Position]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[FieldLine Position]
</span><a href="#local-6989586621679623101"><span class="hs-identifier hs-var">ls</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-282"></span><span>
</span><span id="line-283"></span><span class="hs-comment">-- The body of a section, using either layout style or braces style.</span><span>
</span><span id="line-284"></span><span class="hs-comment">--</span><span>
</span><span id="line-285"></span><span class="hs-comment">-- sectionLayoutOrBraces ::= '\\n'? '{' elements \\n? '}'</span><span>
</span><span id="line-286"></span><span class="hs-comment">--                         | elements</span><span>
</span><span id="line-287"></span><span class="annot"><a href="Distribution.Fields.Parser.html#sectionLayoutOrBraces"><span class="hs-identifier hs-type">sectionLayoutOrBraces</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#IndentLevel"><span class="hs-identifier hs-type">IndentLevel</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#Parser"><span class="hs-identifier hs-type">Parser</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-type">Field</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-288"></span><span id="sectionLayoutOrBraces"><span class="annot"><span class="annottext">sectionLayoutOrBraces :: IndentLevel -&gt; Parser [Field Position]
</span><a href="Distribution.Fields.Parser.html#sectionLayoutOrBraces"><span class="hs-identifier hs-var hs-var">sectionLayoutOrBraces</span></a></span></span><span> </span><span id="local-6989586621679623099"><span class="annot"><span class="annottext">IndentLevel
</span><a href="#local-6989586621679623099"><span class="hs-identifier hs-var">ilevel</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-289"></span><span>      </span><span class="hs-special">(</span><span class="hs-keyword">do</span><span> </span><span class="annot"><span class="annottext">Parser ()
</span><a href="Distribution.Fields.Parser.html#openBrace"><span class="hs-identifier hs-var">openBrace</span></a></span><span>
</span><span id="line-290"></span><span>          </span><span id="local-6989586621679623098"><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679623098"><span class="hs-identifier hs-var">elems</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IndentLevel -&gt; Parser [Field Position]
</span><a href="Distribution.Fields.Parser.html#elements"><span class="hs-identifier hs-var">elements</span></a></span><span> </span><span class="annot"><span class="annottext">IndentLevel
</span><a href="Distribution.Fields.Parser.html#zeroIndentLevel"><span class="hs-identifier hs-var">zeroIndentLevel</span></a></span><span>
</span><span id="line-291"></span><span>          </span><span class="annot"><span class="annottext">Parser Int -&gt; Parser ()
forall s (m :: * -&gt; *) t u a.
Stream s m t =&gt;
ParsecT s u m a -&gt; ParsecT s u m ()
</span><a href="../../parsec/src/Text.Parsec.Combinator.html#optional"><span class="hs-identifier hs-var">optional</span></a></span><span> </span><span class="annot"><span class="annottext">Parser Int
</span><a href="Distribution.Fields.Parser.html#tokIndent"><span class="hs-identifier hs-var">tokIndent</span></a></span><span>
</span><span id="line-292"></span><span>          </span><span class="annot"><span class="annottext">Parser ()
</span><a href="Distribution.Fields.Parser.html#closeBrace"><span class="hs-identifier hs-var">closeBrace</span></a></span><span>
</span><span id="line-293"></span><span>          </span><span class="annot"><span class="annottext">[Field Position] -&gt; Parser [Field Position]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679623098"><span class="hs-identifier hs-var">elems</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-294"></span><span>  </span><span class="annot"><span class="annottext">Parser [Field Position]
-&gt; Parser [Field Position] -&gt; Parser [Field Position]
forall (f :: * -&gt; *) a. Alternative f =&gt; f a -&gt; f a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IndentLevel -&gt; Parser [Field Position]
</span><a href="Distribution.Fields.Parser.html#elements"><span class="hs-identifier hs-var">elements</span></a></span><span> </span><span class="annot"><span class="annottext">IndentLevel
</span><a href="#local-6989586621679623099"><span class="hs-identifier hs-var">ilevel</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-295"></span><span>
</span><span id="line-296"></span><span class="hs-comment">-- The body of a field, using either inline style or braces.</span><span>
</span><span id="line-297"></span><span class="hs-comment">--</span><span>
</span><span id="line-298"></span><span class="hs-comment">-- fieldInlineOrBraces   ::= '\\n'? '{' content '}'</span><span>
</span><span id="line-299"></span><span class="hs-comment">--                         | content</span><span>
</span><span id="line-300"></span><span class="annot"><a href="Distribution.Fields.Parser.html#fieldInlineOrBraces"><span class="hs-identifier hs-type">fieldInlineOrBraces</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Fields.Field.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#Parser"><span class="hs-identifier hs-type">Parser</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-type">Field</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-301"></span><span id="fieldInlineOrBraces"><span class="annot"><span class="annottext">fieldInlineOrBraces :: Name Position -&gt; ParsecT LexState' () Identity (Field Position)
</span><a href="Distribution.Fields.Parser.html#fieldInlineOrBraces"><span class="hs-identifier hs-var hs-var">fieldInlineOrBraces</span></a></span></span><span> </span><span id="local-6989586621679623097"><span class="annot"><span class="annottext">Name Position
</span><a href="#local-6989586621679623097"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-302"></span><span>      </span><span class="hs-special">(</span><span class="hs-keyword">do</span><span> </span><span class="annot"><span class="annottext">Parser ()
</span><a href="Distribution.Fields.Parser.html#openBrace"><span class="hs-identifier hs-var">openBrace</span></a></span><span>
</span><span id="line-303"></span><span>          </span><span id="local-6989586621679623096"><span class="annot"><span class="annottext">[FieldLine Position]
</span><a href="#local-6989586621679623096"><span class="hs-identifier hs-var">ls</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LexerMode
-&gt; Parser [FieldLine Position] -&gt; Parser [FieldLine Position]
forall p. LexerMode -&gt; Parser p -&gt; Parser p
</span><a href="Distribution.Fields.Parser.html#inLexerMode"><span class="hs-identifier hs-var">inLexerMode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; LexerMode
</span><a href="Distribution.Fields.Parser.html#LexerMode"><span class="hs-identifier hs-var">LexerMode</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="Distribution.Fields.Lexer.html#in_field_braces"><span class="hs-identifier hs-var">in_field_braces</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Parser (FieldLine Position) -&gt; Parser [FieldLine Position]
forall (f :: * -&gt; *) a. Alternative f =&gt; f a -&gt; f [a]
</span><a href="../../base/src/GHC.Base.html#many"><span class="hs-identifier hs-var">many</span></a></span><span> </span><span class="annot"><span class="annottext">Parser (FieldLine Position)
</span><a href="Distribution.Fields.Parser.html#fieldContent"><span class="hs-identifier hs-var">fieldContent</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-304"></span><span>          </span><span class="annot"><span class="annottext">Parser ()
</span><a href="Distribution.Fields.Parser.html#closeBrace"><span class="hs-identifier hs-var">closeBrace</span></a></span><span>
</span><span id="line-305"></span><span>          </span><span class="annot"><span class="annottext">Field Position -&gt; ParsecT LexState' () Identity (Field Position)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name Position -&gt; [FieldLine Position] -&gt; Field Position
forall ann. Name ann -&gt; [FieldLine ann] -&gt; Field ann
</span><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-var">Field</span></a></span><span> </span><span class="annot"><span class="annottext">Name Position
</span><a href="#local-6989586621679623097"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">[FieldLine Position]
</span><a href="#local-6989586621679623096"><span class="hs-identifier hs-var">ls</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-306"></span><span>  </span><span class="annot"><span class="annottext">ParsecT LexState' () Identity (Field Position)
-&gt; ParsecT LexState' () Identity (Field Position)
-&gt; ParsecT LexState' () Identity (Field Position)
forall (f :: * -&gt; *) a. Alternative f =&gt; f a -&gt; f a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621679623095"><span class="annot"><span class="annottext">[FieldLine Position]
</span><a href="#local-6989586621679623095"><span class="hs-identifier hs-var">ls</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LexerMode
-&gt; Parser [FieldLine Position] -&gt; Parser [FieldLine Position]
forall p. LexerMode -&gt; Parser p -&gt; Parser p
</span><a href="Distribution.Fields.Parser.html#inLexerMode"><span class="hs-identifier hs-var">inLexerMode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; LexerMode
</span><a href="Distribution.Fields.Parser.html#LexerMode"><span class="hs-identifier hs-var">LexerMode</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="Distribution.Fields.Lexer.html#in_field_braces"><span class="hs-identifier hs-var">in_field_braces</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[FieldLine Position]
-&gt; Parser [FieldLine Position] -&gt; Parser [FieldLine Position]
forall s (m :: * -&gt; *) t a u.
Stream s m t =&gt;
a -&gt; ParsecT s u m a -&gt; ParsecT s u m a
</span><a href="../../parsec/src/Text.Parsec.Combinator.html#option"><span class="hs-identifier hs-var">option</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(FieldLine Position -&gt; [FieldLine Position])
-&gt; Parser (FieldLine Position) -&gt; Parser [FieldLine Position]
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679623093"><span class="annot"><span class="annottext">FieldLine Position
</span><a href="#local-6989586621679623093"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">FieldLine Position
</span><a href="#local-6989586621679623093"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Parser (FieldLine Position)
</span><a href="Distribution.Fields.Parser.html#fieldContent"><span class="hs-identifier hs-var">fieldContent</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-307"></span><span>          </span><span class="annot"><span class="annottext">Field Position -&gt; ParsecT LexState' () Identity (Field Position)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name Position -&gt; [FieldLine Position] -&gt; Field Position
forall ann. Name ann -&gt; [FieldLine ann] -&gt; Field ann
</span><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-var">Field</span></a></span><span> </span><span class="annot"><span class="annottext">Name Position
</span><a href="#local-6989586621679623097"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">[FieldLine Position]
</span><a href="#local-6989586621679623095"><span class="hs-identifier hs-var">ls</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-308"></span><span>
</span><span id="line-309"></span><span>
</span><span id="line-310"></span><span class="hs-comment">-- | Parse cabal style 'B8.ByteString' into list of 'Field's, i.e. the cabal AST.</span><span>
</span><span id="line-311"></span><span class="annot"><a href="Distribution.Fields.Parser.html#readFields"><span class="hs-identifier hs-type">readFields</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">B8.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="../../parsec/src/Text.Parsec.Error.html#ParseError"><span class="hs-identifier hs-type">ParseError</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-type">Field</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-312"></span><span id="readFields"><span class="annot"><span class="annottext">readFields :: ByteString -&gt; Either ParseError [Field Position]
</span><a href="Distribution.Fields.Parser.html#readFields"><span class="hs-identifier hs-var hs-var">readFields</span></a></span></span><span> </span><span id="local-6989586621679623092"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679623092"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(([Field Position], [LexWarning]) -&gt; [Field Position])
-&gt; Either ParseError ([Field Position], [LexWarning])
-&gt; Either ParseError [Field Position]
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">([Field Position], [LexWarning]) -&gt; [Field Position]
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; Either ParseError ([Field Position], [LexWarning])
</span><a href="Distribution.Fields.Parser.html#readFields%27"><span class="hs-identifier hs-var">readFields'</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679623092"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-313"></span><span>
</span><span id="line-314"></span><span class="hs-comment">-- | Like 'readFields' but also return lexer warnings</span><span>
</span><span id="line-315"></span><span class="annot"><a href="Distribution.Fields.Parser.html#readFields%27"><span class="hs-identifier hs-type">readFields'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">B8.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="../../parsec/src/Text.Parsec.Error.html#ParseError"><span class="hs-identifier hs-type">ParseError</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.Field.html#Field"><span class="hs-identifier hs-type">Field</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.Position.html#Position"><span class="hs-identifier hs-type">Position</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Fields.LexerMonad.html#LexWarning"><span class="hs-identifier hs-type">LexWarning</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-316"></span><span id="readFields%27"><span class="annot"><span class="annottext">readFields' :: ByteString -&gt; Either ParseError ([Field Position], [LexWarning])
</span><a href="Distribution.Fields.Parser.html#readFields%27"><span class="hs-identifier hs-var hs-var">readFields'</span></a></span></span><span> </span><span id="local-6989586621679623091"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679623091"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-317"></span><span>    </span><span class="annot"><span class="annottext">Parsec LexState' () ([Field Position], [LexWarning])
-&gt; [Char]
-&gt; LexState'
-&gt; Either ParseError ([Field Position], [LexWarning])
forall s t a.
Stream s Identity t =&gt;
Parsec s () a -&gt; [Char] -&gt; s -&gt; Either ParseError a
</span><a href="../../parsec/src/Text.Parsec.Prim.html#parse"><span class="hs-identifier hs-var">parse</span></a></span><span> </span><span class="annot"><span class="annottext">Parsec LexState' () ([Field Position], [LexWarning])
</span><a href="#local-6989586621679623089"><span class="hs-identifier hs-var">parser</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;the input&quot;</span></span><span> </span><span class="annot"><span class="annottext">LexState'
</span><a href="#local-6989586621679623088"><span class="hs-identifier hs-var">lexSt</span></a></span><span>
</span><span id="line-318"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-319"></span><span>    </span><span id="local-6989586621679623089"><span class="annot"><span class="annottext">parser :: Parsec LexState' () ([Field Position], [LexWarning])
</span><a href="#local-6989586621679623089"><span class="hs-identifier hs-var hs-var">parser</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-320"></span><span>        </span><span id="local-6989586621679623083"><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679623083"><span class="hs-identifier hs-var">fields</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Parser [Field Position]
</span><a href="Distribution.Fields.Parser.html#cabalStyleFile"><span class="hs-identifier hs-var">cabalStyleFile</span></a></span><span>
</span><span id="line-321"></span><span>        </span><span id="local-6989586621679623082"><span class="annot"><span class="annottext">[LexWarning]
</span><a href="#local-6989586621679623082"><span class="hs-identifier hs-var">ws</span></a></span></span><span>     </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Parser [LexWarning]
</span><a href="Distribution.Fields.Parser.html#getLexerWarnings"><span class="hs-identifier hs-var">getLexerWarnings</span></a></span><span>
</span><span id="line-322"></span><span>        </span><span class="annot"><span class="annottext">([Field Position], [LexWarning])
-&gt; Parsec LexState' () ([Field Position], [LexWarning])
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679623083"><span class="hs-identifier hs-var">fields</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[LexWarning]
</span><a href="#local-6989586621679623082"><span class="hs-identifier hs-var">ws</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-323"></span><span>
</span><span id="line-324"></span><span>    </span><span id="local-6989586621679623088"><span class="annot"><span class="annottext">lexSt :: LexState'
</span><a href="#local-6989586621679623088"><span class="hs-identifier hs-var hs-var">lexSt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LexState -&gt; LexState'
</span><a href="Distribution.Fields.Parser.html#mkLexState%27"><span class="hs-identifier hs-var">mkLexState'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; LexState
</span><a href="Distribution.Fields.Lexer.html#mkLexState"><span class="hs-identifier hs-var">mkLexState</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679623091"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span class="hs-cpp">

#ifdef CABAL_PARSEC_DEBUG
</span><span class="hs-identifier">parseTest'</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Show</span><span> </span><span class="hs-identifier">a</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-identifier">Parsec</span><span> </span><span class="hs-identifier">LexState'</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">a</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">SourceName</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">B8.ByteString</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-328"></span><span class="hs-identifier">parseTest'</span><span> </span><span class="hs-identifier">p</span><span> </span><span class="hs-identifier">fname</span><span> </span><span class="hs-identifier">s</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-329"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="hs-identifier">parse</span><span> </span><span class="hs-identifier">p</span><span> </span><span class="hs-identifier">fname</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">lexSt</span><span> </span><span class="hs-identifier">s</span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-330"></span><span>      </span><span class="hs-identifier">Left</span><span> </span><span class="hs-identifier">err</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">putStrLn</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">formatError</span><span> </span><span class="hs-identifier">s</span><span> </span><span class="hs-identifier">err</span><span class="hs-special">)</span><span>
</span><span id="line-331"></span><span>
</span><span id="line-332"></span><span>      </span><span class="hs-identifier">Right</span><span> </span><span class="hs-identifier">x</span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">print</span><span> </span><span class="hs-identifier">x</span><span>
</span><span id="line-333"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-334"></span><span>    </span><span class="hs-identifier">lexSt</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">mkLexState'</span><span> </span><span class="hs-operator">.</span><span> </span><span class="hs-identifier">mkLexState</span><span>
</span><span id="line-335"></span><span>
</span><span id="line-336"></span><span class="hs-identifier">parseFile</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Show</span><span> </span><span class="hs-identifier">a</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-identifier">Parser</span><span> </span><span class="hs-identifier">a</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">FilePath</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-337"></span><span class="hs-identifier">parseFile</span><span> </span><span class="hs-identifier">p</span><span> </span><span class="hs-identifier">f</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">B8.readFile</span><span> </span><span class="hs-identifier">f</span><span> </span><span class="hs-operator">&gt;&gt;=</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">s</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">parseTest'</span><span> </span><span class="hs-identifier">p</span><span> </span><span class="hs-identifier">f</span><span> </span><span class="hs-identifier">s</span><span>
</span><span id="line-338"></span><span>
</span><span id="line-339"></span><span class="hs-identifier">parseStr</span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Show</span><span> </span><span class="hs-identifier">a</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-identifier">Parser</span><span> </span><span class="hs-identifier">a</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">String</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-340"></span><span class="hs-identifier">parseStr</span><span> </span><span class="hs-identifier">p</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">parseBS</span><span> </span><span class="hs-identifier">p</span><span> </span><span class="hs-operator">.</span><span> </span><span class="hs-identifier">B8.pack</span><span>
</span><span id="line-341"></span><span>
</span><span id="line-342"></span><span class="hs-identifier">parseBS</span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Show</span><span> </span><span class="hs-identifier">a</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-identifier">Parser</span><span> </span><span class="hs-identifier">a</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">B8.ByteString</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-343"></span><span class="hs-identifier">parseBS</span><span> </span><span class="hs-identifier">p</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">parseTest'</span><span> </span><span class="hs-identifier">p</span><span> </span><span class="hs-string">&quot;&lt;input string&gt;&quot;</span><span>
</span><span id="line-344"></span><span>
</span><span id="line-345"></span><span class="hs-identifier">formatError</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">B8.ByteString</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">ParseError</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">String</span><span>
</span><span id="line-346"></span><span class="hs-identifier">formatError</span><span> </span><span class="hs-identifier">input</span><span> </span><span class="hs-identifier">perr</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-347"></span><span>    </span><span class="hs-identifier">unlines</span><span>
</span><span id="line-348"></span><span>      </span><span class="hs-special">[</span><span> </span><span class="hs-string">&quot;Parse error &quot;</span><span class="hs-operator">++</span><span> </span><span class="hs-identifier">show</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">errorPos</span><span> </span><span class="hs-identifier">perr</span><span class="hs-special">)</span><span> </span><span class="hs-operator">++</span><span> </span><span class="hs-string">&quot;:&quot;</span><span>
</span><span id="line-349"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">errLine</span><span>
</span><span id="line-350"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">indicator</span><span> </span><span class="hs-operator">++</span><span> </span><span class="hs-identifier">errmsg</span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-351"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-352"></span><span>    </span><span class="hs-identifier">pos</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">errorPos</span><span> </span><span class="hs-identifier">perr</span><span>
</span><span id="line-353"></span><span>    </span><span class="hs-identifier">ls</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">lines'</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">T.decodeUtf8With</span><span> </span><span class="hs-identifier">T.lenientDecode</span><span> </span><span class="hs-identifier">input</span><span class="hs-special">)</span><span>
</span><span id="line-354"></span><span>    </span><span class="hs-identifier">errLine</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">T.unpack</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">ls</span><span> </span><span class="hs-operator">!!</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">sourceLine</span><span> </span><span class="hs-identifier">pos</span><span> </span><span class="hs-glyph">-</span><span> </span><span class="hs-number">1</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-355"></span><span>    </span><span class="hs-identifier">indicator</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">replicate</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">sourceColumn</span><span> </span><span class="hs-identifier">pos</span><span class="hs-special">)</span><span> </span><span class="hs-char">' '</span><span> </span><span class="hs-operator">++</span><span> </span><span class="hs-string">&quot;^&quot;</span><span>
</span><span id="line-356"></span><span>    </span><span class="hs-identifier">errmsg</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">showErrorMessages</span><span> </span><span class="hs-string">&quot;or&quot;</span><span> </span><span class="hs-string">&quot;unknown parse error&quot;</span><span>
</span><span id="line-357"></span><span>                                  </span><span class="hs-string">&quot;expecting&quot;</span><span> </span><span class="hs-string">&quot;unexpected&quot;</span><span> </span><span class="hs-string">&quot;end of file&quot;</span><span>
</span><span id="line-358"></span><span>                                  </span><span class="hs-special">(</span><span class="hs-identifier">errorMessages</span><span> </span><span class="hs-identifier">perr</span><span class="hs-special">)</span><span>
</span><span id="line-359"></span><span>
</span><span id="line-360"></span><span class="hs-comment">-- | Handles windows/osx/unix line breaks uniformly</span><span>
</span><span id="line-361"></span><span class="hs-identifier">lines'</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">T.Text</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-identifier">T.Text</span><span class="hs-special">]</span><span>
</span><span id="line-362"></span><span class="hs-identifier">lines'</span><span> </span><span class="hs-identifier">s1</span><span>
</span><span id="line-363"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="hs-identifier">T.null</span><span> </span><span class="hs-identifier">s1</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-364"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="hs-identifier">otherwise</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="hs-identifier">T.break</span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">c</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">c</span><span> </span><span class="hs-operator">==</span><span> </span><span class="hs-char">'\r'</span><span> </span><span class="hs-operator">||</span><span> </span><span class="hs-identifier">c</span><span> </span><span class="hs-operator">==</span><span> </span><span class="hs-char">'\n'</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">s1</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-365"></span><span>                  </span><span class="hs-special">(</span><span class="hs-identifier">l</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">s2</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-identifier">Just</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">c</span><span class="hs-special">,</span><span class="hs-identifier">s3</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-identifier">T.uncons</span><span> </span><span class="hs-identifier">s2</span><span>
</span><span id="line-366"></span><span>                         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="hs-identifier">T.uncons</span><span> </span><span class="hs-identifier">s3</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-367"></span><span>                              </span><span class="hs-identifier">Just</span><span> </span><span class="hs-special">(</span><span class="hs-char">'\n'</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">s4</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-identifier">c</span><span> </span><span class="hs-operator">==</span><span> </span><span class="hs-char">'\r'</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">l</span><span> </span><span class="hs-glyph">:</span><span> </span><span class="hs-identifier">lines'</span><span> </span><span class="hs-identifier">s4</span><span>
</span><span id="line-368"></span><span>                              </span><span class="hs-identifier">_</span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">l</span><span> </span><span class="hs-glyph">:</span><span> </span><span class="hs-identifier">lines'</span><span> </span><span class="hs-identifier">s3</span><span>
</span><span id="line-369"></span><span>                          </span><span class="hs-glyph">|</span><span> </span><span class="hs-identifier">otherwise</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-identifier">l</span><span class="hs-special">]</span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-372"></span><span class="annot"><a href="Distribution.Fields.Parser.html#eof"><span class="hs-identifier hs-type">eof</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#Parser"><span class="hs-identifier hs-type">Parser</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-373"></span><span id="eof"><span class="annot"><span class="annottext">eof :: Parser ()
</span><a href="Distribution.Fields.Parser.html#eof"><span class="hs-identifier hs-var hs-var">eof</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Parser LToken -&gt; Parser ()
</span><a href="#local-6989586621679623080"><span class="hs-identifier hs-var">notFollowedBy</span></a></span><span> </span><span class="annot"><span class="annottext">Parser LToken
forall s (m :: * -&gt; *) t u.
(Stream s m t, Show t) =&gt;
ParsecT s u m t
</span><a href="../../parsec/src/Text.Parsec.Combinator.html#anyToken"><span class="hs-identifier hs-var">anyToken</span></a></span><span> </span><span class="annot"><span class="annottext">Parser () -&gt; [Char] -&gt; Parser ()
forall s u (m :: * -&gt; *) a.
ParsecT s u m a -&gt; [Char] -&gt; ParsecT s u m a
</span><a href="../../parsec/src/Text.Parsec.Prim.html#%3C%3F%3E"><span class="hs-operator hs-var">&lt;?&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;end of file&quot;</span></span><span>
</span><span id="line-374"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-375"></span><span>    </span><span class="annot"><a href="#local-6989586621679623080"><span class="hs-identifier hs-type">notFollowedBy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#Parser"><span class="hs-identifier hs-type">Parser</span></a></span><span> </span><span class="annot"><a href="Distribution.Fields.Lexer.html#LToken"><span class="hs-identifier hs-type">LToken</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Fields.Parser.html#Parser"><span class="hs-identifier hs-type">Parser</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-376"></span><span>    </span><span id="local-6989586621679623080"><span class="annot"><span class="annottext">notFollowedBy :: Parser LToken -&gt; Parser ()
</span><a href="#local-6989586621679623080"><span class="hs-identifier hs-var hs-var">notFollowedBy</span></a></span></span><span> </span><span id="local-6989586621679623078"><span class="annot"><span class="annottext">Parser LToken
</span><a href="#local-6989586621679623078"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Parser () -&gt; Parser ()
forall s u (m :: * -&gt; *) a. ParsecT s u m a -&gt; ParsecT s u m a
</span><a href="../../parsec/src/Text.Parsec.Prim.html#try"><span class="hs-identifier hs-var">try</span></a></span><span> </span><span class="hs-special">(</span><span>    </span><span class="hs-special">(</span><span class="hs-keyword">do</span><span> </span><span class="annot"><a href="Distribution.Fields.Lexer.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">Position
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679623077"><span class="annot"><span class="annottext">Token
</span><a href="#local-6989586621679623077"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Parser LToken -&gt; Parser LToken
forall s u (m :: * -&gt; *) a. ParsecT s u m a -&gt; ParsecT s u m a
</span><a href="../../parsec/src/Text.Parsec.Prim.html#try"><span class="hs-identifier hs-var">try</span></a></span><span> </span><span class="annot"><span class="annottext">Parser LToken
</span><a href="#local-6989586621679623078"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; Parser ()
forall s (m :: * -&gt; *) t u a.
Stream s m t =&gt;
[Char] -&gt; ParsecT s u m a
</span><a href="../../parsec/src/Text.Parsec.Prim.html#unexpected"><span class="hs-identifier hs-var">unexpected</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Token -&gt; [Char]
</span><a href="Distribution.Fields.Parser.html#describeToken"><span class="hs-identifier hs-var">describeToken</span></a></span><span> </span><span class="annot"><span class="annottext">Token
</span><a href="#local-6989586621679623077"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-377"></span><span>                           </span><span class="annot"><span class="annottext">Parser () -&gt; Parser () -&gt; Parser ()
forall (f :: * -&gt; *) a. Alternative f =&gt; f a -&gt; f a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">() -&gt; Parser ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-378"></span></pre></body></html>